Your ex's erratic moods and behaviors are about him and his issues, not you. One thing you can be sure about is that BPD behaviors are predictably unpredictable. Yes, they can be described in a text book but it's still erratic, sort of "mood of the moment" and the perceptions are quick to morph at the drop of a hat.
Whether consciously or unconsciously, his behaviors are probably designed to keep you confused, off balance and unsure what to do, to pressure you into retreating back into the prior failed patterns of the past. We have a word for it... FOG... Fear, Obligation, Guilt. You may not have that much Fear but like most of us, the sense of Obligation and Guilt are so strong. If you ponder that, that's probably why you stayed in the relationship as you did. In effect, you ended up sabotaging yourself, just like we did. You kept trying and trying but kept failing. It wasn't you, it was the disorder.
You will find that having consistent boundaries will be most helpful. You may think that occasional exceptions to your boundaries is being fair and nice but his perceptions lead ex to perceive them as encouragement and incentive to try for more concessions.
Please browse our Groups from the menu bar above, especially
Library: Tools and skills workshops. You will find an assortment of topics on improving communication skills. Also others on Boundaries. What are boundaries? People with BPD (pwBPD) resist boundaries, a nice way is to imagine herding cats.
So what to do?
Boundaries are for us. A simple example or framework can be:
If you do or don't do ___ then I will do or not do ___. In short you set the boundary (violations) and the result (consequences). Sounds simple but it takes time to get used to the concept. Yes, the ex won't always comply but it ought to reduce some of the problems you've been experiencing.