I *hope* that what she really meant to say was:
"I remember you have lost a child and I really feel for you. I do hope that this pregnancy will work out better."
and that she just phrased it in an awfully clumsy way.
I also hope that she realised, afterwards, that it was really not a good idea to bring this up and especially not in such a blunt and hurtful way, and that she learns from it.
There's always hope. But, by golly, if I had been in your daughter's shoes, I would have had such trouble not to smack her right in the face or yell at her.