I think it is natural for children to test, at some point, whether adults are full of shit with their warnings and admonishments, because frankly, sometimes they are full of shit.
God stepped in to teach this particular child that those particular warnings were useful.
If the child was not permanently injured then I think this was the best possible outcome.
If the child is engaged in seriously dangerous behavior (high risk of permanent injury or death), then the slap really needs to be hard (as in just short of permanent injury) to cause first time learning.
If the adults delivered that hard of a slap then the child might have incorrectly learned that the adults are abusers with avoiding of the adults in the future (and their useful warnings).
Because God delivered the slap, the child is more likely to learn the correct lesson, that these particular warnings from these particular adults are helpful.