Miscarriage number 2

I have having my hopes up both miscarriage I didn’t even know or feel pregnant I’m 29 and my first one was when I was 27 it was right after my mom passed away. The second one yesterday the 23th of March. I don’t understand why this happens I feel like a failure and feel like I’m doing something wrong.Has this happened to anyone else?