You're not a failure in any sense of the word, Sweety! Loosing your babies was no more your fault than the abuse you received or the mental illness than can come upon you when you least expect it.
There's always a good reason for things that happen, even if they hurt us. This was totally out of your hands, Hon. Stop beating yourself up over things that are beyond your control.
You know I've lost a daughter and two grandsons, one of which was attached to my hip. That was a bitter loss because my own daughter, my first born rejected me and took her two sons with her. I was bitter and mourned the loss, I blamed myself completely... until I realized that it was beyond my control, she had made her choice.
You're blessed in the fact that this wasn't your case. It just wasn't meant to be. There's a good reason, even if you don't know it right now. It will become clear to you in time. I promise.
Don't let this be a stumbling block in your growth and health. You've accomplished so much since I first met you! It's perfectly normal to still feel the pain. I still do, too. Allow it to come, but then let it go. Don't hang on to it.
__________________
Psalm 119:105 Thy word is a lamp unto my feet, and a light unto my path.