It's not a miscarriage if the fertilized egg never implants. IUD are safe it's just that like all forms of BC it's not 100% safe. Mirena is 99% and the Paragard is 99.4%. and the pill is about 95% effective.
The IUD works a few ways. 1. The strings thicken the cervical mucus so that sperm cannot enter. 2. Blocks the falopian tubes so that sperm cannot enter. 3. Makes the lining of your utuerus thin so that a fertilized egg cannot implant.
If you do think you are pregnant you need to take a test right away so they can take out the IUD. If you find out you are pregnant then you have until about 13 weeks to have IUD removed or they have to leave it in during the pregnancy (if you don't want to terminate).