Stop trying to figure out why someone didn’t want you or trying to figure out what you “need” to work on to make them want you. Creating a habit of changing the things about you that don’t align with the people that you wanted to want you is the fastest way to lose your connection to self. You won’t be for everyone you want. Everyone who wants you won’t be for you.
If you find that there is a pattern developing of not being able to connect with people and this leads you to want to identify the things you need to work on, I highly recommend BEING ALONE and looking INWARD. If you don’t know where to begin, hire a therapist or a life coach (depending on the specifics of your needs) who will know the right questions to ask to assist you in guiding yourself toward healing or achieving a specific mindset.
Never change who you are for the sake of connecting with someone else. You will lose yourself every single time.