Missed miscarriage twice

In September 2017 I had a missed miscarriage about 7 weeks along. Was able to conceive and now have a 14 month old. I got pregnant again saw heartbeat at 6 weeks and 8 weeks now at 9 weeks no heartbeat....I’m devastated because thought we were in the clear. Anyone had something similar ? Dr wants to test fetus says it’s rare for this to happen after two good heartbeats. Is there any hope for a successful pregnancy?