I totally relate to this. I'm quite aware that my failures have stemmed from issues with emotional intimacy; that said, I'm unwilling to presumptively infer that the same is true for you. That would be my best guess based on what you've shared, but it's ultimately up to you to determine the source of your difficulties here (and I encourage you to do so sooner rather than later). If you feel comfortable doing so and ever feel interested in discussing your experiences further, feel free to message me. I'm always happy to talk about this subject. Anyway, here's the brief version of my story:
I had a really promising opportunity at forming a romantic relationship when I was thirteen. I overcame my approach anxiety and cultivated a rewarding relationship (not in any formal sense, mind you) with a girl whom I absolutely adored. I'm not exactly sure how she perceived whatever it was that we had, but it culminated in an interaction during which she ultimately offered very encouraging reciprocation. And as soon as she did, I freaked out and pretty much cut off all ties with her. I just totally panicked and stewed in self-doubt to the point of paralysis. I couldn't take the final step to actually confront her with how I felt. It was the greatest interpersonal failure of my life. And the period after this event was awkward and painful in the extreme.
It was so bad that I couldn't even make eye contact with her without nearly having a panic attack. To this day, I've been unable to even contemplate a romantic relationship. On top of the fear which ruined this one (still alive and well, unfortunately), this experience serves as an additional excuse to remain comfortably inert. It is a testament to the enduring influence of self-reinforcing, avoidant coping mechanisms; this happened years ago, and yet still it directs my behavior.
I'd like to comment at this point that, in this instance, it clearly wasn't rejection which I feared. After all, this anxiety manifested itself only after I detected a clear signal of interest from her. What stopped me then and haunts me to this day is fear of loss after a substantial emotional investment. I mean, I was anxious enough at that time that being rejected up front would have been a humiliating and generally terrible experience. But what would be infinitely worse, what almost makes me tremble just to think about, is the failure of a relationship after commitment. After becoming thoroughly attached to someone, after sharing oneself entirely . . . and watching it crumble before one's eyes by a mere whim of circumstance. I feel like that girl still owns a part of my soul. I can't imagine the devastation I would have felt if this hypothetical had come to fruition. For an individual as sensitive and intense as myself (and yes, I realize how silly this must sound to many given that I was only thirteen at the time), it would have simply torn my heart in two. And I felt compelled to protect myself from that, even if it meant sabotaging my happiness. This post is already pretty long, and I could go on for days about this stuff, so I'll just leave it at that for now. Hopefully you find something of use in here, and best of luck to you.