4 When your children sinned against him, he gave them over to the penalty of their sin.

Read Job 8:4 Using Other Translations

If thy children have sinned against him, and he have cast them away for their transgression;
If your children have sinned against him, he has delivered them into the hand of their transgression.
Your children must have sinned against him, so their punishment was well deserved.