Sorry to hear this. Take care of yourself.
I had an unexpected pregnancy 2 years ago, when my youngest was a baby and we thought our family was complete. I suddenly noticed pregnancy symptoms, realised I'd missed 2 periods, and the tests were very strong positives. But I felt something was different from my other pregnancies, just an intuitive feeling so I booked a private scan. I could tell from the monitor it was a molar pregnancy. There was no heartbeat, cystic blurry areas. They sent me straight to hospital, where they confirmed it and booked me in for surgery next day. Overnight my HCG went very high, I couldn't stop vomiting, and they did an emergency suction procedure to remove the partial molar. Histology confirmed it was partial (if a full molar you have about a year of blood tests after) but partial they discharge you once you have a negative pregnancy test. I bled a lot after the procedure, but went home next day.
We didn't try for another as ours was unplanned, but it was a big shock and very emotional, especially with all the hormones and surgery.
But I don't think it will affect fertility? I was told not to get pregnant for 6 months. I discussed the procedure with a friend, apparently the suction thing to remove womb contents is the same as she had for a termination. The womb lining is removed and the 'parts of conception' or beginning of the foetus, but nothing else happens medically. A bit like having surgical treatment for a missed miscarriage.
It helped me to think of it as nature going a bit wrong, rather than losing a pregnancy or baby, as with molar pregnancy the foetus is non-viable from the start. The painful thing is thinking you're pregnant, feeling all the symptoms, getting excited then being told it isn't a real pregnancy and could turn cancerous if you don't have the surgery quickly.
I'm so sorry you didn't find out until your 12 week scan. Please don't let it put you off trying again when you feel ready. I felt quite alone having a molar as it's rare compared to the number of women who miscarry in first trimester