Though you seem to have a good sense about what your problem may be, I would recommend seeing a therapist. A therapist can determine if your understanding of the problem is accurate.
You should want to be in a relationship because you are compatible with someone or because you want to spend time with them, not because you fear being alone. Fear of being alone is always the wrong reason to enter a relationship.
The main problem with not wanting to be alone is that it significantly increases the likelihood that you will settle for someone who is not right for you. The phrase “settle for” by definition means accepting in spite of complete satisfaction. Settling is a problem for a variety of reasons but primarily because it leads to unhappiness.
It was not that long ago that you were an independent woman, absent the fear of being alone. You can easily return to that place in your life. The fact that you had two unsuccessful relationships is likely driving your fear.
The kind of issues that you are dealing with are exactly the type of problems that therapists deal with on a regular basis. Therapy can assist you in examining your past relationships in great detail and help you to determine if you contributed to their ending. Your problem is very correctable with therapy. I hope you will consider it. Please take care.