Most regulated businesses are big corporations with attached bureaucracies.
When they get a lawsuit because somebody was injured, what will happen is an analysis how this bug could occur.
If it is found that the problem was caused by a library or third party that could get sued, the corporation will sue them and get their money back.
If they find there's no one to sue like with FOSS, they will likely start regulating the use of FOSS.
This has the perverse effect that after a lot of iterations of this cycle the whole toolchain is designed for "sueability" not for quality, performance, or any other worthy goal. Further the toolchain becomes increasingly opaque and proprietary.
Even though the proprietary software has more bugs, and they're harder to find due to their closed source nature, the leaders of Big Corp have covered their asses. The engineers build more workarounds and spend less time improving the quality of Big Corp's code base. The quality of the product suffers. But none of it is the fault of anyone. That's what's important.