It is pretty clear in the Bible story that the whale swallowing Jonah wasn't meant as a punishment from God, it was God saving him from drowning. So it was actually provision to give him a second chance. The whale itself was the start of Jonah's second chance.
Quote by Phil Vischer, American animator (1966), about chance. One of 15 Phil Vischer quotes on Quotlr.