Laws are never perfect unfortunately.
Since Roe Vs Wade, 60 million children were murdered while living inside their mothers. That's worst than the Nazi holocaust.
Now, to compensate it, some states have the freedom to fine grain their laws, instead of using a one size fits all principle.
I hope that the states adjusts this to avoid child holocaust, but also to avoid mother's and babies having to suffer horribly in a case like one you described