Hello. Let me start by saying that I don't personally have BPD. I'm writing here because I'm desperate for some advice. My (former) best friend has BPD, and I suspect that that was the reason she broke up our friendship. I miss her terribly. But I should really tell you the story from the beginning:
Last year around September I was well on my way into a serious depression. I had recently graduated and was (still am) unemployed, completely broke and lonely. My best friend at the time, let's call her D, was on her way to Spain to live with her boyfriend. My only other friend was moving to Korea. 
This story begins at D's farewell-party. I was the designated driver, so I stayed sober. At that party I met my now lost friend, G. We clicked pretty much instantly. She was smoking weed and was having fun. We laughed and talked. So after a few days I wrote D if she thought it'd be okay for me to contact G. I was in desperate need for a new friend and I really liked her. After she confirmed that it'd be fine, I wrote G on Facebook. Again, we hit it off and talked a lot. We met for lunch a few days later. 
We became very close very fast. It made us both nervous, but we really enjoyed each others company. She was very upfront and honest about her disorder and I didn't mind. I wanted to be there for her. I really tried to console her whenever it hit her. And it started hitting her often. She broke up and got back together with her boyfriend. She was suicidal. Her friends gave her shit over the breakup. And I was there. Listening and supporting her as much as she would let me. 
She got a little better, but never good. Then our friend D got pregnant. And we both freaked out a little. We talked about it for hours. We were both unsure if we would want children and we were scared to lose D to motherhood, however selfish that may sound. Over the next few months, about spring time this year, we spent a little time apart, since I was busy with a course I was taking for my CV. I could tell that she missed me, but I was exhausted from the course work and couldn't give her much. 
When it was over we started hanging out again, a lot, and tried to get excited for our friend D. She was returning for the summer to have her baby at home. And I guess that's where it started. G was considering having a child herself and all the talks we'd had about D started bothering her. And when D gave birth it got worse. I had just found out that I have pcos and it made it really hard to see D, because it came to close to the reality of me being infertile. When I finally went to see her, she understood and was very empathetic. But G was freaking out. She thought I'd abandon her if she were pregnant. I tried to calm her down, but I doubt she believed me. 
I could feel her getting more evasive and distant. She'd cancel our plans and wouldn't talk much anymore. I could feel something was wrong, so I asked her if she was okay and if she considered leaving me. She assured me that everything was fine. But a week later she did break up our friendship. 
I was devastated. She'd kept asking me to be more open and trusting towards her. And then I did exactly that, as I cried when I asked if she was leaving me earlier. It felt like being punished for obliging. 
I walked around for a week wondering what I'd done wrong, since she hadn't given me any explanation. When I finally confronted her, she said I was selfish. This had always been a big fear of mine, so naturally I believed her. I took the blame. We talked it out and made up. Sort of. 
She was getting more and more depressed afterwards. Again, I tried being there for her, but it got a lot harder. She would write me late at night after chasing her pills with half a bottle of rum. It was hard to see her like that and I told her that it was tearing me up. I still did what I could, but I started distancing myself when things got too much for me. She'd agreed that it was a good idea. 
She told me that she was starting another round of therapy and I supported her wholeheartedly. She talked about it a lot and she was scared, so I tried cheering her up. I tried using humor to lighten the tension. 
But a few weeks ago, out of the blue, she sent me a long message explaining that she simply couldn't take being my friend anymore. Again, she accused me of being selfish and inappropriate. 
And I initially gave up. I somehow knew that there was no way to convince her otherwise. I was also pretty dumbfounded. I hadn't seen it coming and was deeply hurt. So I replied in a way I shouldn't have. I told her I was relieved. It had gotten really hard being her friend. And I told her that I wasn't her therapist, so I couldn't always be expected to treat her exactly the way she needed to be. 
After a few days, when I had calmed down, I wrote her again. I told her that I understood that her mind works differently and that I can accept that. I told her that I could deal with it. I knew that she may have thought about our friendship for hours, over analyzing things that were inconsequential. I also wrote that I'd always be there for her, should she need me. She never wrote back. 

Did I mess this up entirely? Is there anything I can do? I'm writing this here because I desperately want to understand her and I need to know if I can or should do anything? 