Quran 8:8
God’s favour is not unconditional. The prophet Yunus did not fulfill a criterion, he was punished by confining him in the belly of a fish. Rasul and the Muslims did not know before the incident is done whether they have fulfilled the criteria or not.