Good point about the moral not getting to the story. I think it’s worth noting that’Punishment’ is in this case PQD ’visit’. I think a visit from Hashem should always be welcomed. It’s how we learn even if fearful.

“Behold, my angel will walk before you, and on the day of my visitation, then I will visit upon them their sin.”

Excerpt From
Bob’s Bible: The Torah
Bob MacDonald