@Gelati don't worry you can just if the exercises after you have given birth
@Gelati is right @bbhope your boss has some responsibility too. I have a team that I manage and I wouldn't say stuff like that to a heavily pregnant woman. Just not worth adding stress to the pregnant woman.
I must say infertility also changed me. Didn't impact my work at all. Funnily that was the one thing I could control, so I made sure I did well. Fertility or infertility was so out of our control. But it made me angry, sad, etc. I was mainly scared though. Scared that we will never have a baby. I think this whole journey also taught me to be more appreciative and patient but I wouldn't wish this on anyone. Tough few years.
Anyway @bbhope don't worry too much about what your boss said.