well, ok then
Not kidding. This actually solves a gaggle of philosophical problems.
One of the most difficult books of the bible is Job, but it truly does give a window into the issue that no other book does.
The devil accuses Job to God. God lets the devil wipe out almost everything for Job. Ultimately after enduring a lot of grief from his friends, God lectures Job on how great He is, then restores Job’s fortunes.
What, God, are You mad?
No He is not mad. He is just showing where the root of goodness is. Job considered it worth the grief, but not while the grief was going on.