Don't listen to sakoz. Sometimes, I wonder how he sleeps at night, knowing that vulnerable people might take his uninformed advice to heart. Other times, I like to think his insanity stems from long term sleep deprivation, but that might be a just-world fallacy talking.
OP, it's very normal for a person like you and a person like her to get together. If you think about it, you or someone like you satisfies a lot of needs for someone like her, and to some extent she likely satisfies some needs for you or someone like you, so it's a fairly probable event. It's not your fault that she behaved the way she did to you, at least not in the sense that her behavior was a reaction to your behavior. It's just how she behaves, and the way she behaves was a factor in you eventually being attracted to her, just like the way you behave was a factor in her being attracted to you.
She likely suffers from multiple disorders and frequent abnormal behaviors that aren't necessarily pathological, and it would likely be an exercise in futility for anyone - even a skilled clinical psychologist or psychiatrist - to try and understand her within the context of a DSM diagnosis, because her case is so severe and compounded.
You're hardly crazy. There was absolutely, unquestionably "nothing you could do for her" in any realistic sense. The only thing you "could have done for her" was fundamentally mold your personality and preferences around hers. That would've been crazy - it's doubtful that it would have been in the interest of your happiness to do so
If you try and get detailed enough, you can spend the rest of your life trying to figure out why she did what she did, because that's just how complex a single human mind is, especially in extreme cases like your girl here! Try to think about all the things you did right that will carry over to future relationships with less obviously dysfunctional girls - patience, nonconfrontation, empathy and all those other complex skills you had to exercise are all much, much more effective when you're using them on someone who's capable of using them back.