First, let's ditch the idea of "prime of your life." If you assign some magical value to the years you have already spent, then it doesn't matter what you do from now on, those "best years" are always behind you. Poisonous thinking.
Yes, in our 20s and 30s we have lots of capabilities that we begin to lose when we are older. If someone told you that your younger years would be filled with something that it wasn't, then I'm sorry you were misled, but consider then that you have been misled about the limits of an "old man" at the ripe old age of 43.
It sounds like you beat yourself up for not magically teleporting yourself out of your present situation. You can't. You can grow into something new, but it takes patience. A few years is actually quite a long time, and a lot can happen in them. All you have to do is be consistent. I know that sounds hard. For constant procrastinators and self-deceivers like us (or at least like me), consistency is kryptonite!
I was very depressed for quite a while... divorced, unemployed, and alone in an unfamiliar city. I did two things that I credit with helping me find my way out. The first is, I wrote down several aspirational sentences. One was about the career I wanted. Another was about the relationship I wanted with a woman someday. Another was about the kind of dad I want to be. And the last was about the kind of human being I want to be. I wrote these down every single day. I tweaked them over time, and in so doing got a clearer picture of who I really am.
The second thing I did was be honest with myself every day about something I did that helped me get where I wanted to go with any of those things. Early on, I had to teach myself to take credit for what seemed like very small victories. If I wrote even one line of code, I counted it as a win. If I took a walk or otherwise got some exercise, that was a win. Going to places where I might be able to network was a win, even if I didn't actually connect with anyone. If I had even just an interaction with a woman who I found interesting, I counted it as a win.
What I learned was that I had no idea when things would happen, or how. Despite writing my statements down each day, I had a hard time seeing how I could find a partner in my situation. One day, I did. It was most unexpected, and I never saw it coming. But I think if I had not kept reminding myself what I wanted, I would not have gotten it.
My life is definitely not perfect, and there is much I still want to grow into to really live up to those statements. But I can point to some of it and be very proud now, and I can feel myself making progress towards what's missing.
Set your direction, and then learn to be happy with very slow and small steps, and eventually you'll find yourself taking giant ones in rapid succession. Good luck!