H's gf tweeted that she thinks her bf is having a midlife crisis.
ROFL! I love it! Aren't you glad to know even she can see there's something wrong with him?
And as for all your talk about your shortcomings in the marriage - yes, it's important to learn from that, and not let a future relationship become sex-starved. But on the other hand, let me be perfectly clear - that was NOT the cause of your breakup!
A sane man expresses his need, asks you to go to counseling with him to work on the marriage, takes you away for a romantic weekend without the kids, etc.
And a man who leaves his wife only because he feels unloved by her, doesn't abandon his children in the process. A sane man would be putting extra effort into his kids at this point.
This is MLC, probably compounded on top of chronic mental health issues he has. His irregular work history, struggles with anxiety, etc - you have been compensating for him for a long long time.
Take care of your kids, get legal advice to protect your self financially, stick to the high road, and get out and enjoy your life. I know that last part sounds strange, but once this is all over, regardless of which way it turns out, you will regret wasting too much of your life's energy on the sad stuff. Get out and do fun things with the kids and with friends, pursue a dream, live BIG.