Failure is underrated. We learn a lot from failure. In many cases a lot of things went right, but it only took one thing to go wrong which then puts the whole mission in the category of failure. Of course, there are many days too when something has clearly gone wrong, but the end goal is still accomplished and so to the outside it looks like a complete success.
Mountaineering is a great teacher in this respect. People will often view success and failure as making the summit or not making the summit. But in reality it's far more nuanced, there is living and not living of course, which is far more important than any rocky summit. There are injuries, there are friendships, there are new personal altitude records, there are good weather days low on the mountain, there are good meals, there are card games, there are movies and reading books, there is sleeping in on rest days. Climbing mountains is about a lot more than just making the summit.
So it is the same in business. Failing at a goal can teach a company a lot about what went right, even when something went wrong. In fact, sometimes succeeding can teach an organization the wrong lessons, such as, of the 100 steps in the process, actually only 17 contributed to their success. Since the thing had never been tested with less than 100 process steps, hours will be debated about taking away one or two steps, when 83 of them are not needed. Or perhaps everyone worked 60-80 hour weeks to make it a success, so that becomes normal at the company for the next 15 years.
I recently read the book Scrum by Jeff Sutherland, and one of the ideas is go to market when you have some feature that works, but it's only 20% of the complete product. That might be easier done in software than hardware, but the idea of making a product with the minimum features and getting to market, so that you can get actual customer feedback makes a lot of sense. What engineers like and think are important are not always the things that customers think are important.
So when a company has a "failure" it's a huge learning opportunity. Most failures expose one or several weaknesses, and even if it is systemic, it's never the whole process or the whole system that was wrong. It's okay to fail. In fact, testing to failure is often a great way to test systems and components so that then you know, everything was okay, right up until the fraction of a second where it failed. Without breaking things it can be really hard to definitively say how long a product will last.
So the next time you see failure, before excoriating the organization or the people for their incompetence, consider all the things that went right, and hope we can all learn from the failure so that it doesn't get repeated.