There are NO guarantees when it comes to pregnancy. Clomid doesn't necessarily stop a missed abortion from occurring - it is intended to stimulate your ovaries to produce and release eggs, if that isn't already happening: https://www.healthline.com/health/pregnancy/how-does-clomid-work
Since you are able to get pregnant, Clomid may not be the correct solution for you. Your doctor will likely check your hormone levels, and if they are already fine and you are releasing eggs, there is no indication that you should take Clomid.
I am very sorry. Do you mean you lost a baby during pregnancy either by miscarriage or by choice? Either way, I am very sorry for your loss. hugs to you. Clomid usually works as curfew explains by stimulating egg production and release. The issue I've heard is that we only produce so many eggs in our lifetime and too much clomid can result in 'running' out of eggs sooner. Don't know your age or if this is a concern for you but talk to your doctor about that.