One problem is that it is extremely hard for management to tell good devs apart from bad devs. So that puts a huge randomness in as far as who is given authority and interesting projects and so on. Some of the best devs I have worked with, the best bosses I have worked for would not rehire. It is quite odd.
Managers tend to want people at both ends of the spectrum.
High quality is sometimes not worth paying for (in engineering time) if you don’t know if you’re building the right thing yet.
Interviewing is it's own skill, and even then some complete head scratcher cases get through (who can't code and interview poorly).
Even these people make out pretty good. I know educated people who say they'd kill for $60k, and I've seen plenty of braindead programmers pulling that in.
I think you overestimate the quality of median software engineer. Even at a company like Amazon, I think something like 20% engineers can barely code. Add to that industry expectation to work independently with little guidance and not that many people who will fit the bill.
There are lots of junior engineers, who with guidance and mentoring can actually flourish but your average "move fast" startup won't invest in them.