I was 18 weeks when I found out through a sono that my baby boy passed away but I didn't know about it before then. He was measuring 14 weeks by then. The grief from it made the miscarriage start to happen physically and I went to the hospital at midnight (9am when I found out) to give birth and had a dnc done the next day
I don't know how long until it becomes dangerous, but I thought I was between 10-12 weeks when I had my miscarriage, and the baby was only the size of around 5 and a half weeks [Had an ultrasound after I started bleeding, and they picked up a VERY faint heartbeat of 58 bpm] I could have been seriously off on my dates, but I don't think I was, so I think my miscarriage was due to the baby not growing correctly.
I'm pretty sure it happened right away with my 1st and 3rd miscarriages, but my 2nd was a missed miscarriage. Baby passed away around 7 weeks, and I didn't pass the baby until 11 weeks. I didn't even know until my OB couldn't find a heartbeat.