You quote Job at the beginning of the book
This is God and Job at the end of the book
Job 38
The LORD Speaks
1 Then the LORD answered Job out of the storm. He said:
2 “Who is this that darkens my counsel
with words without knowledge?
Job 42
Job
1 Then Job replied to the LORD :
2 “I know that you can do all things;
no plan of yours can be thwarted.
3 You asked, ‘Who is this that obscures my counsel without knowledge?’
Surely I spoke of things I did not understand,
things too wonderful for me to know.
Right. And yet Job was not 'prospered' for a good chunk of time. Apparently that was part of God's plan. You said it yourself here.