Rejection can feel like a failure, but it has some surprising benefits.
Graduating with a Computer Engineering degree, I had hopes of becoming a software engineer. Having applied to many positions with no replies, I was given a few opportunities to interview. It wasn't until getting rejected several times that I realized my coding skills were lacking.
At this point, I realized I needed to find other career opportunities.
I asked myself "What else am I good at?". I had an internship as a QA tester and also had interfaced with stakeholder management during my senior project. Although I was not a strong candidate for software engineering, I landed a role as a software consultant in QA.
After a few years in my role, I set the goal to become a Product Manager (PM).
I aimed to become a PM for consumer-facing products like Spotify or Netflix. But because my experience was more in internal and backend products, I was turned down from consulting on those accounts and likewise from employers I interviewed with. It came to me that although I was less fit for that type of PM role, I had a wealth of experience and knowledge in understanding the developer experience and building backend services. I spent time building my PM skillset and shipped infrastructure and platform products. I've been a Platform PM now for a year.
Failure and rejection provide feedback on your weaknesses. It is up to you to leverage your strengths to cover those gaps. Growth is not linear but trends upwards the faster you realize the other paths you can take.