I would argue that software is too complex to be created by non-experts. This is why so much of the software ever created is garbage. There is no magic wand or process that will ever turn an average team into a unit that can produce great software.
The real answer of course is to pay more to hire better developers. You may even need to pay “hazard pay” if your software is boring enough.
From the perspective of the whole industry there's no such thing as "hire better developers" - if one company does that, then all it means that the "better developer" moves from company A to company B, and an "average developer" moves from company B to company A. It's an almost-zero-sum game - it's an appropriate mechanism to assign better(more expensive) developers to more important jobs and average or weaker developers to less important jobs, but it doesn't influence (in the short term) the total quantity of "better developers" available, that's achieved only by education and training (and immigration, and overseas outsourcing). "Hazard pay" means that you attract a developer to work on your boring software, but they quit working on someone else's boring software. It's not satisfactory to answer questions of "how should developers work" and "how should developers be managed" just with respect to top developers working in top places, they need to be answered with respect to median developers working on median tasks.
Your answer, including "The real answer of course is to pay more to hire better developers" and "software is too complex to be created by non-experts" is essentially saying that only a portion of the current developers should be writing code at all. Okay, so let's assume all the companies hire only "better developers" and everyone else gets pushed out of the industry - but there's not enough developers as is, so what do we do with half as many developers? Writing half as much software is not really an option.
I think we continue doing what we always do: write mountains of terrible code. My argument is that it would be less terrible if you at least put yourself in the mindset of good development, and to me that means not obsessing over “catching someone slacking off”.
I also will believe we have a real developer shortage when dev pay and exec pay are more closely aligned. As it is, I see a lot of room to pull from exec salaries to pay for devs (which would be required if there was a shortage).
The real answer of course is to pay more to hire better developers. You may even need to pay “hazard pay” if your software is boring enough.