I was a junior after companies had already decided to out source low-level development roles. And I also faced the roadblock of lacking a degree, or any college at the time, so internships were not an option.
What I did was learn the skills that companies were hiring for and kept applying until I finally found some tiny company willing to pay me peanuts ($8.50hr, I'm not joking, I continued to work two jobs that entire year). They got a cheap worker, and I got experience that I leveraged into a better job.
How does that translate to your situation? If you're in college, find internships, it's the easiest way to get your foot in the door. Are you out of college or never went? Time to look at job postings, evaluate the skills they are looking for, and learn those skills.
Yeah, it sucks but that's also a fact of life in this industry. I have to "reskill" every few years too, because not every job I've had segues into another job. In reality, every senior developer decays over time into a junior because the tech landscape changes pretty quickly, and your choices are to mitigate that decay through learning the tech that's being hired for, or become a people manager.
I'd suggest working on your defeatest attitude though. As someone with pretty low self-esteem myself, I get it. Just four hours ago I was calling myself an idiot for making a mistake, but instead of wallowing, I took the time to "prove it" and verify that I was the root cause of the the issue. If I was, I would take those findings and learn from them, but it turns out, all I proved was that I was not responsible and I got to pat myself for building out a system that allowed me to figure this out.
You're going to have to find a way to tell yourself that you're proud of what you've done. Nobody else is going to say it. And rejection sucks. You have to learn to graciously accept rejection, and objectively look at what you've done and compliment yourself. I take the "shit sandwich approach" of finding two good things about what I've built, and one point of improvement. YMMV there, but it definitely helps with the mental health to compliment yourself when you deserve it.