The workaround here would be that the unborn child would either always exist as a hidden character for all pregnancies, or if your character dies with a pregnant wife, the game creates an "age: unborn" child. Tricky though, and yea, the reason this isn't in the game is that all titles always need someone to have that title at all times, a title can't hang in limbo while waiting for the possible heir to be born.
Particularly since no one in the game would know whether the child would be a girl or boy, which would make a difference to the child's legitimate heirship in most successions.