Why do bad things happen to good people? This topic is as old as Job. God did not give Job a specific answer to this question and I have not seen where He has been more explanatory. Knowing the character of God, we can trust Him no matter what comes our way. I cling to the answer Job gave his wife in Job 2:10 "But he said to her, You speak as one of the foolish women speaks. Shall we indeed accept good from God and not accept adversity? IMO, anything more is speculation.
HTH
NASB is my go to version, too