PCOS/ miscarriage

Hi ladies! So on Xmas eve I got a BFP, but then in Xmas day had really bad cramping & bleeding so I miscarriage at 4 weeks, the fertile egg never implanted. I have PCOS so, the had me on Metformin to regulate my insulin & we also tried letrozole for ovulating. Has anyone experience this before. ??