What to do with repeated rejections for PhD position
You say you have been rejected a lot, but give no indication whatever of why that is. It isn't random, I suspect. I can suggest two possible scenarios and from them you can, perhaps, devise a strategy. 

The first situation is that you are just applying to places that are so off the scale that no one is actually likely to be admitted. The top institutions normally have tremendous competition for slots and some of them have very few slots available. Dartmouth, in CS, for example is a great institution, but its doctoral program is very small. If they get hundreds of applications for any available position, then the likelihood of any particular person gaining admission is pretty miniscule. So perhaps you are just aiming too high. Since you have come close a few times, perhaps not impossibly high, but there are probably other options. 

The second is that you are deficient in some way and need to improve either your technical or personal skills or both. That isn't criticism, since I don't know anything about you, but perceived issues are probably apparent to people once you get into the application process. Arrogant people don't find easy acceptance, to name just one personal "flaw" that some folks exhibit. At the other end of the scale, people who project extreme introversion often come off as less able than they are. 

As for the technical side, you can work on that without formally being in a program. You can study and write in your field, for example. If you have the time and can expend the effort to do it effectively, you will improve the skills that others may feel you lack. 

But, it is important, I think, that you also find a way to learn at least a bit about why you haven't made the cut. Perhaps someone you have corresponded with in the past can point you in the direction you need to go. Feedback can be valuable, not just about your final position in the ranking, but why you weren't higher. Find a way to ask.