theres this thing called the internet, to which the OS connects, filled with adversarial actors, so no this is not correct at all
Why?
There's a thing called formal verification of software.
The perfect OS doesn't exist yet. Right now, I'd rather use some OS than no OS.
Why a perfect OS doesn't exist? Good question. Maybe because the programming field is relatively immature so we're still figuring things out and we don't apply formal verification to everything. Compare that to say, architecture, where we can calculate how much weight a structure can withstand. Or the other way around: what do we need to do to support an X amount of load.
I guess the stakes are lower too. I wouldn't walk on a wobbly bridge, but I don't mind if a desktop app I use crashes occasionally under unusual circumstances. Critical software (say, aviation) is generally written with more care but it's still not perfect.
OSes also can be "excellent products". They don't need yearly updates, there's nothing inherent to them that would prevent them from being made perfect, finished and never updated again.
The only case when an otherwise perfect OS would truly need to update is when new hardware capabilities require OS-level changes to support. Sometimes it may be beneficial to expose these new hardware capabilities as APIs for apps to consume. But again, adding new APIs shouldn't break the existing ones. For example, on phones, this would include things like notched screens, fingerprint readers or multiple rear-facing cameras.
> Dependencies break.
Don't update dependencies. Pick one version that serves you well and stick with it forever. I'm serious.
> Security updates.
It seems like we've already realized that writing code that deals with complex data structures received from untrusted parties in memory-unsafe languages like C is a terrible idea. If you exclude memory safety vulnerabilities, the attack surface shrinks drastically. You'd run out of security vulnerabilities pretty fast if you'd have any to begin with.
> Your house/car need maintenance. Your cities roads/bridges/tunnels need maintenance.
Houses, cars, and road infrastructure are made out of atoms and exposed to elements and stress of our imperfect real world. They wear out. Code doesn't. In 100 years, the bits would be the same they are today (as long as you use a reliable enough storage medium).