Hi, weclome to the forum.
This glitch does happen from time to time. Seems one of the best ways to fix it in a vanilla game is to temporarily move your sims out.
So, save your house to your library and then move you sims onto an empty lot using the phone interaction. Bulldoze their house and then replace it with the copy from your library. Move your sims back in again using the phone interaction.
As always save your game before doing any of this just in case something goes wrong for you as then you can quit without saving and you will not be any the worse off.
Another quick thing to check is that you haven't placed any item over or near the bed with the MOO cheat as this can cause issues too.
Now: if you are using mods then they could be causing this issue in which case you will need to remove all your mods, delete the localthumbcache.package file from your The Sims 4 folder and test. If try for baby works as normal then you'll know it is a mod/cc causing the issue.
Tips for testing Problem Mods