Job is being dangerously sarcastic with God.
But he did kind of need that maybe, to get through the first three companions, who had to bow to Job in the end, and need him now, then, as now "their intercessor between them and God, and God and them now" instead of the other way around, that they failed at with Job, and part of God's anger was directed at them, those first three supposed companions, or false counselors, who are "also speaking without knowledge" basically, and God's anger is with pretty much all of them not only over that, but/and with all of what happened with all of them, cause many think those counselors were angels, even perhaps Spirits maybe...?
Elihu is an interesting character, and some say is like, the or at least a, Son of God, Son of the Most High God, the True Father, who speaks and come on the scene after Elihu addresses Job and those other three companions a bit (Job 32) (Job 38)...
Regardless of whether Job needed it or not though, he still needed to repent, and did, and God greatly blessed him and highly favored him, and highly exalted him in the end, for going through all of what he went through, even more so than he ever had before... And maybe as a kind of reward as well, IDK...? But He made Job that way and chose his tale to be told and that is part of the story as well, but that is a topic for another time, and perhaps in another or other threads...
I'm not suggesting that Being in any sarcastic with God in any way shape or form, OK, in way, and I don't advise it at all, but if Job was kind of being that way, (He was with the three companions at times), if he was kind of being that, considering everything he had, then lost, and alll that he went through and was going through, thinking that you were a pretty good person all of your life, so not knowing why, I could maybe understand how he might have being a little sarcastic at times, bitter maybe, if only a little, take a couple pokes at God, or the God of it all, sometimes, but I don't think he ever even ever "disrespected" God, and he most certainly did not curse Him to His face, like Satan said he would, I don't think he ever disrespected God cause he seemed to be being very careful not to be doing that, but all in all and "considering"...? Understandable, I think, and I think it was very forgivable, and I think God understood, but, God also wanted to "elevate him even more so than before", and sometimes the only way to do that is...? well...? Remember God was basically bragging on Job and kind of showing him off, to others, or in front of others, angels maybe...?
God Bless!