Fall back to /usr/lib/os-release when /etc/os-release is absent
It's not mandatory for /etc/os-release to be present. The os-release(5)
manual says :
The file /etc/os-release takes precedence over /usr/lib/os-release.
Applications should check for the former, and exclusively use its data
if it exists, and only fall back to /usr/lib/os-release if it is
A valid os-release(5) file is not expected to have any commands in it.
Hence, there's no chance of a non-zero exit code from the last command
inside /etc/os-release getting forwarded as the exit code of the attempt
to source it , and getting misinterpreted as the file being absent.
The /etc/os-release file is owned by root. It's assumed that the root
user knows what they are doing and has put in place a sane file.