My friend it hurts my heart to hear that you feel like you failed. If we wouldn't allow someone to say something to our best friend, we shouldn't be saying the same things to ourselves.
I have no experience to offer here, but I know that nurturing those negative thoughts won't help you here. Sending strength, hugs, and tons & tons of admiration and respect.