How exactly does that follow? You say on the one hand that deterrence won't be realized by punishing this woman, but on the other hand a deterrent effect would be present if we brought in some sort of government licensing scheme to regulate all medication of children. Is that about right?
I'm not understanding how you're getting from point A to point B here.
It's the difference between "it's a crime to do something stupid" and "it's a crime to do concrete thing x, no matter what you're thinking when you do it."
You get deterrence with the second type because then any time a person gives medicine to a child, they think "Hey, I'm breaking the law."
Making a law that factors in being careless/stupid/dangerous won't work because, while people do think "Hey, I'm giving this medicine to a baby", they will rarely think "I'm also an idiot and dangerous", and thus will not consider themselves to be doing something that amounts to a crime.
Monkeyleg has a good example: drunk driving. They never think they endanger people - that's why the crime isn't "to drive dangerously while drunk", it's driving with a set amount of alcohol that makes the crime, negligence/intentions aside. So now you have people thinking twice before they drink and drive, even if they don't believe they'd be dangerous on the road.
If you made the law something as vague as "it's illegal to drive and negligently cause risk to others", you would have zero effect on drunk drivers, because they don't think they're doing something dangerous for the most part...which is just like the mom in this case.