Life is nuts, over here in Germany the maximum for the woman is one year or fine. I don't think there's actually been a case like that and if there was judges would find every mitigating circumstance they possibly could. I mean German courts regularly acquit women who kill their child within the first days of its life by ruling temporary insanity, they're not known to not be understanding when people face exceptional circumstances they had no way to prepare themselves for.
It's gotta be on the books though as the availability of punishment-free at-will abortions hinges on the managed procedure in the first place, the state's constitutional duty to protect life requires it to minimise the number of abortions and welfare and said procedure (counselling where you'll be told about all those welfare programs, three days cooldown) as well as absolutely zero demand for or providers of back-alley abortions is the way it's done (providers, btw, face up to three years, six months to five years if against the will of the woman or putting her in danger)
It's kinda "but I would have gotten the building permit anyway, I'm legally entitled to get one!' -- "but you still got to apply for it" territory. Life, as said, is a nuts punishment for that kind of thing.
On the flipside authorities still might want to investigate miscarriages simply to make sure that noone else slipped the woman something.