That and companies are just hilariously bad at finding workers they want to hire for nebulous reasons. I have no doubt even if my company hired 95% of the workers it had marked down as "no hire" they'd be able to squeeze a salary's of value worth out of each of them (well, if management is competent, which it tends to not be). I'm sure those of us who've been around long enough can all attest to some side of seeing form of this dysfunction. I'm more than happy to reject them for selfish reasons, of course, like "I don't want this person on my team" or "this person seems like an asshole" or "I don't want to teach this person their third language after java and typescript". Etc.
I mean there are terrible interview candidates out there, but the people who literally can't code at all tend to be easy to filter out.
I'm curious if there's any way to observe the salary margins that separate the top of the labor market from the bottom. Surely there are. That would probably give a big signal as to how much undue attention is given to, e.g., Senior vs Junior developers and American workers vs H1Bs. I'd put money that some of this complaining about lack of labor is actually not wanting to hire fresh grads and eat the cost of training when they'd be just fine. (Also the H1B thing, but that's already discussed to death)