That's so sadistic, that wasn't Satan?
Parents allow or impose consequences to signal to children when their choices could be wiser.
Torture is generally off limits. And then God didn't think through the invention of epidurals for his punishment which didn't say it would expire once they were invented, or only wanted to keep punishing the poorest most downtrodden without access to hospitals?
But they are consequences, not punishment. For punishment, see a sibling comment elsewhere on this page that has a massive quote.