When you get your rejections, are you getting feedback that it's because you don't know X skill that it was on their checklist?
The developer shortage, by the numbers, is real, but it's not why companies can't hire. Let's say, in aggregate, there are 1,000 developers looking for work, and there are 5,000 companies trying to fill developer positions. If the hiring market were efficient, then each of those thousand developers would be hired somewhere immediately, and the shortage would be felt more acutely, since open positions wouldn't even be attracting resumes. But the hiring market isn't efficient. Each of those companies has dozens of resumes from that pool of a thousand developers, and for whatever reason, they're passing on them.
So why is the hiring market inefficient? Because there was this transformational shift that Silicon Valley started, and slowly went and infected the rest of the job market. Do you remember the days when developers used to have to wear a suit and tie to work? Why was that even a thing? Because formal culture papers over the natural differences that exist between people on an individual level in order to try and help establish a baseline for productivity. When Silicon Valley drove a corporate culture shift, and people started to have an expectation that everybody who they hired needs to be cool enough to grab a beer with, hiring managers slowly started to filter out people who they felt personal friction with during the interview.
Is there a cost and risk to training people? Sure. But there's a cost (in management overhead) to hiring people in the first place. And people don't leave bad companies - they leave bad bosses. If it takes a company more than three months to train somebody, then either the person was woefully underqualified or the company is woefully dysfunctional. And if new employees are leaving you that quickly (frequently enough that it's not exceptional), then it's not for a salary bump elsewhere. Recall that those people who would leave that quickly, went through the same recruiter-interview-reject-repeat cycle you're going through now.
The sad fact of the matter is, hiring is now a numbers game. If you're looking to move, you need to spam recruiters and job postings, and give the process time. Last time I went through this (within the past year, not Silicon Valley), I spent four months with zilch, probably something like 40-50 rejections (including FAANG companies), and then I had six offers inside of a week, which also gave me leverage when negotiating.
Stop focusing on why some company didn't like you (your haircut? your sandals? your sense of humor? who knows, and why should it matter) and start focusing on finding more companies to spam with your resume. Good luck.