All perfect praise be to Allah, The Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallahu ‘alayhi wa sallam, is His slave and Messenger.
We could not find any hadeeth with the wording which you mentioned. Perhaps you are referring to the hadeeth that reads, “If a man says: ‘The people are ruined!’ then he is the most ruined of them all.” [Muslim]
This hadeeth refers to a person who utters these words, and not to the one who thinks that people have been ruined or shall be ruined. Also, it does not apply to everyone who says these words; rather, it is confined to those who say it out of contempt and ridicule. An-Nawawi said about the above-mentioned hadeeth:
“Scholars agreed that the dispraise (in the hadeeth) applies to the one who says this to belittle people, denigrate them, claim himself superior to them, and claim that there is evil within their hearts, for only Allah knows the inner secrets of His creation. As for the person who says these words as an expression of grief for what he sees in himself and in people of weak adherence to the religion, there is no harm on him. This is similar to saying, ‘I do not know about the nation of the Prophet except that they all observe the prayer.’ This is how Imaam Maalik interpreted the hadeeth, and the scholars adopted his interpretation.” [Sharh Muslim]
Thus, you come to know that this does not apply to Prophet Yoonus (Jonah), may Allah exalt his mention. The Prophet, sallallahu ‘alayhi wa sallam, said about him, “None should say: I am better than Yoonus ibn Matta.” [Al-Bukhaari and Muslim]
Firstly, he never said ‘the people are ruined’; rather, he left his disbelieving people when he thought that they would not believe and would not respond to his call without being commanded to do so by Allah. Secondly, the person who says ‘the people are ruined’ out of sadness and pity and not out of contempt and ridicule bears no sin, as stated above by An-Nawawi .
Allah knows best.