I've been really lucky with medical staff on the whole and not too many stupid comments from friends or family. Some people didn't say anything at all, which I was grateful for because they were obviously struggling with it and I'd rather they gave me a hug and kept they silence if they didn't know what to say.
"Sorry for your loss" while trite is actually pretty much all you need. And people who really acknowledge the loss not just of the physical baby but the hopes and dreams and plans and future you lose with it.
Some people feel the need to give you a good news story which can go one of two ways. "My friend had 15 miscarriages but they got their baby in the end, after IVF and 10 years" was one I didn't find particularly helpful.
That gives me a tiny tea in my eye Notreallyarsed, I'm sorry you lost your baby boy and glad your gran was kind and understanding.
OP, sending you a hug, I'm sorry you've been through this and lost your baby. MN has been a font of such wisdom and understanding about MC for me. There's a thread on TTC after a MC if you want to join us when the time is right again.
People say stupid things for lots of reasons. Sometimes they're stupid, or thoughtless, or helpless and just get it wrong 