“Thank God, I passed!”
How about “Thank God, I failed”?.

It is as if the goodness of God depends on their situation.
I rarely see people thank God after a failure.
Many people perceive God as a genie who grants wishes.