OP I get the impression that you're looking at success in relationships a bit too logically... like, here's a checklist of things men have to be to attract a woman, these are where you can put ticks (kind, good conversationalist), these are where others' ticks are better (richer, taller).
It doesn't work like that, a good relationship is about a connection with that individual person (not just any woman or all women), not a scientific formula. When you click with someone it's surprising to find that what they're attracted to is sometimes a quality in yourself you've completely overlooked, not the thing you think is your best selling point.
Seeing both yourself and women as individuals, not items to be compared to other men or other women, will be a key change in your mindset. If a woman goes for a taller, richer man - and some will - then she's not someone who would have clicked with you anyway. Somewhere else, there's someone who will.
In terms of working on yourself, there's a fine line between trying to mould yourself into someone you're not, and improving who you essentially are. You say you need to be more spontaneous... it's worth a try. But if you're ultimately not a spontaneous person that's fine. And there are women out there who don't want a spontaneous partner. I think for most people, your 20s are a journey of finding out who you are at your core and becoming comfortable with that.
Failed relationships are part of that. It doesn't sound like either of your breakups happened for a reason that reflects badly, or at all, on you. First woman wasn't ready for a relationship - like so many people in their early 20s. Second got bored in lockdown - that's something that's affected the strongest long-term marriages!
My main piece of advice to someone in your situation is to meet more people. Not for relationships specifically. Broaden your social circle. Meet as many people as you can. Connect with as many people as you can. Make friends with people, men and women. Find your tribe, not just your person. The more people you know, the more people you'll meet through them, the more chance you have of finding someone you click with.