I agree that the course that makes the most sense is between the two poles of Not Invented Here and Never Invented Here.
Complex systems tend to evolve toward being optimal. Optimal complex systems are vulnerable to single point failure. This exists in our financial system and in our software systems.
For efficiency (optimality) most people rely on a few databases: Oracle, SQLSever, Postgres, MySQL, MongoDB. If one of these databases is released with a significant problem, this problem will have a widespread impact.
Similar problems exist with cities which depend on complex networks to supply water, power, food and waste removal.
The only way to reduce the chance of failure is to reduce the optimality of the system. This approach has historically been taken with bridge design, where the bridge is designed to be stronger than the models say it has to be, by a significant fraction.
To get back to the software case: we build software on top of complex operating systems and frameworks. This provides us a great deal of leverage, but we are vulnerable to problems in the systems that we use. This is the price we pay for optimizing the effort needed to build complex software systems.