Then you get the stuff that lurks in the middle that could be a software, electrical or mechanical problem (or all 3), and that is where the bugs like this occur. I think its more a result of splitting up work into domain silos, so they do not think about problems that arise in the other domains that can be fixed easily in another. This can lead to one or more domains getting no time at all to implement their part of the system as they spent most of the time budget waiting on another domain to finish. Watchdogs and other "things are going crazy" sort of belt&braces protection are the first parts of a design to get dropped when in a time crunch.
For quite a bit of software these days, the correct program and the description of the correct program are pretty similar artifacts.
My brain was going mental mobius strip when I was originally responding and thinking of something along these lines. Maybe what I was getting at is that the an idea like the Halting problem doesn't apply as viciously to hardware?
With complex software, it's pretty dang hard to layout an entire program in specifications without going down the provably correct approach, which likely will run into limitations when the real world is involved. Waterfall dev for operating systems of the past come to mind.... Probably the best you can do is be very stringent with your coding standards, something space agencies are the masters of.