Infallibility of the Prophets
Question

                Prophets were maasoom? If they were sinless, how to understand the story of Prophet Yunus Alaiyhi Salaam?
Praise be to Allah.Firstly:
The Prophets were infallible in conveying the message from Allah, may He be exalted, so their words could not be but true and they did not make any mistake, whether deliberate or otherwise, in conveying the message.
They were also infallible and protected from committing major sins such as zina (adultery) and theft.
They were also infallible and protected from committing minor sins that are indicative of baseness, such as stealing a morsel of food or giving short measure.
Some of them may have made mistakes in minor issues that are not indicative of baseness, but they did not persist in that; rather Allah, may He be exalted, pointed that out to them and drew their attention to that, so they corrected their mistakes.
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said: The view that the Prophets were infallible and protected from committing major sins, but not minor sins, is the view of the majority of Muslim scholars and of all the sects… It is also the view of most of the scholars of tafseer and hadith, and the fuqaha’. Indeed nothing was narrated from the early generations, the leading scholars, the Sahaabah and Taabi‘een and those who followed them except that which is in accordance with this view.
End quote from Majmoo‘ al-Fataawa, 4/319
As-Safaareeni (may Allah have mercy on him) said: al-Qaadi ‘Iyaad said: The Muslims are unanimously agreed that the Prophets were infallible and protected from committing shameful deeds and major sins that doom a person. Some of them were of the view that they were also protected from committing makrooh actions deliberately. End quote.
Al-‘Allaamah as-Sa‘d at-Taftazaani said: The idea of their being infallible and protected from committing any sin is subject to further discussion. They were protected from disbelief (kufr) both before and after receiving revelation, according to scholarly consensus, and were protected from committing major sins deliberately, according to the majority.
Rather the difference of opinion has to do with whether the view of being protected from sin is based on religious texts or rational argument. As for whether they might commit sin by mistake, the majority of scholars regard it as possible. As for minor sins, it is possible that they might have committed some deliberately, according to the majority of scholars, contrary to the view of al-Jabbaa’i and his followers; and it is possible that they might have committed some minor sins by mistake, according to consensus, except the type of sin that is indicative of baseness, such as stealing a mouthful of food or giving short measure. But the scholars said that they would be corrected and would stop that.
End quote from Lawaami‘ al-Anwaar al-Bahiyyah (2/305).
The evidence that they might commit minor sins, but would not be allowed to persist therein, is as follows:
Allah, may He be exalted, tells us about Adam (interpretation of the meaning):
“… Thus did Adam disobey his Lord, so he went astray.
Then his Lord chose him, and turned to him with forgiveness, and gave him guidance”
[Ta-Ha 20:121-122].
This indicates that Adam (blessings and peace of Allah be upon him) fell into sin, but he was not allowed to persist in it, and he repented to Allah from it.
Shaykh al-Islam (may Allah have mercy on him) said:
As for the Messenger (blessings and peace of Allah be upon him), he was infallible with regard to what he conveyed of the message, according to the consensus of the believers… There is no dispute among the leading scholars that he (blessings and peace of Allah be upon him) could not have been left without being corrected if there had been any mistake in conveying the message, because the one who is infallible in conveying the message could not be such if it were possible for him to be left alone and not corrected in the event of him making a mistake.
With regard to the scholars disputing other issues, such as their disputing whether it was possible for Prophets to commit mistakes or minor sins, we may note that they would not be allowed to persist in that (rather they would be corrected). If we say that they were protected and not allowed to persist in that, then by saying this we are avoiding the well-known dispute. Indeed, most of the early generation, the leading scholars and the majority of the ummah think that it was possible for Prophets to commit minor sins, and they say that they were protected from persisting in sin (and would be corrected). They say: This was allowed to happen so as to attain the virtue mentioned in the verse in which it says that Allah loves those who turn unto Him in repentance and loves those who purify themselves (al-Baqarah 2:222). This meaning is also indicated by the Qur’an and Sunnah, and by the reports.
End quote from Bughyat al-Murtaad (501).
He also said: The correct view is that of the majority of scholars, which is in accordance with the reports narrated from the early generations, which is to believe that the Prophets were protected from persisting in all sins, and to reject the view which says that they might be allowed to persist in sin.
The view of those who believe that the Prophets were infallible boils down to what we have mentioned above. There is nothing in the argument of those who deny infallibility to indicate that any of the Prophets committed a sin and was allowed to persist in it (and that it was not corrected). Rather those who believe that the Prophets were infallible based their argument on the fact that it is prescribed to follow their example, and that makes no sense if it is possible for them to commit sin.
It is well-known that following their example is only prescribed in matters in which they were approved of, not what they were forbidden to do and they then recanted it. Moreover, their commands and prohibitions should be followed in issues that are not abrogated. As for what has been abrogated of their commands and prohibitions, it is not permissible to regard them as commands and prohibitions, let alone to follow them. They use a similar argument to say that committing sins is contrary to perfection, or that committing sin on the part of one who is more greatly blessed by Allah is more abhorrent, or that it may put people off the Prophet (if he committed sins), or similar rational arguments.
This would be true if he had persisted in that or had not recanted it, otherwise by virtue of the sincere repentance that Allah accepts, He raises the penitent individual to a level higher than he was before.
End quote from Majmoo‘ al-Fataawa (10/294).
One example of that is what happened to Yoonus (peace be upon him) when he left his people before Allah gave him permission to do so. Allah, may He be exalted, says (interpretation of the meaning):
“And (remember) Dhun-Noon (Yoonus/Jonah), when he went off in anger”
[al-Anbiya’ 21:87].
Al-Ameen ash-Shinqeeti (may Allah have mercy on him) said: The phrase “in anger” in this verse refers to when he was angry with his people. He angered them when he left them and they feared that the punishment would come upon them, and they angered him when he called them to Allah for a while, but they did not respond to his call. So he warned them of the punishment, then he left them as the Prophets usually did before punishments came down, but he did that before Allah gave him permission to leave. This was stated by Abu Hayyaan in al-Bahr.
In Soorat as-Saaffaat it says “When he ran to the laden ship” [as-Saaffaat 39:140]. The word translated here as ran is the same word used in Arabic to refer to a runaway slave, because Yoonus left before his Lord gave him permission. Therefore, this word is used. Later in the same soorah (v. 142) he is described as having done an act worthy of blame.
In Soorat al-Qalam there is an indication that the Prophet of Allah Yoonus (blessings and peace of Allah be upon him and upon our Prophet) was too hasty in leaving when he was angry with his people, and he was not patient as he should have been, based on the fact that Allah says, addressing our Prophet (blessings and peace of Allah be upon him) in this soorah (interpretation of the meaning):
“So wait with patience for the Decision of your Lord, and be not like the Companion of the Fish, when he cried out (to Us) while he was in deep sorrow”
[al-Qalam 68:48].
The fact that Allah, in this verse, is enjoining our Prophet (blessings and peace of Allah be upon him) to be patient, and telling him not to be like the Companion of the Fish (i.e., Yoonus, peace be upon him) indicates that the Companion of the Fish was not patient as he should have been.
End quote from Adwa’ al-Bayaan (4/241).
This does not detract from the status of Yoonus (peace be upon him).
Shaykh al-Islam (may Allah have mercy on him) said:
What we find in the story of Dhu’n-Noon (i.e., Yoonus) of things that he might be blamed for was all forgiven, and Allah replaced it with hasanaat and raised him in status. After he emerged from the belly of the fish and repented, he was of higher status than he had been before all that happened. Allah, may He be exalted, says (interpretation of the meaning):
“So wait with patience for the Decision of your Lord, and be not like the Companion of the Fish, when he cried out (to Us) while he was in deep sorrow.
Had not a Grace from his Lord reached him, he would indeed have been (left in the stomach of the fish, but We forgave him), so he was cast off on the naked shore, while he was to be blamed.
But his Lord chose him and made him of the righteous”
[al-Qalam 68:48].
This was in contrast to his condition when the fish swallowed him, as Allah says (interpretation of the meaning):
“Then a (big) fish swallowed him and he had done an act worthy of blame”
[as-Saaffaat 37:142].
Allah tells us that in that situation, he was worthy of blame for he had done an act that was worthy of blame.
The blame in that situation was not when he was cast sick upon the naked shore. That was after he said, “La ilaha illa Anta (none has the right to be worshipped but You (O Allah)), Glorified (and Exalted) are You (above all that (evil) they associate with You). Truly, I have been of the wrong-doers” [al-Anbiya’ 21:87], and at that time he was of a higher status than he had been before all of that happened.
What matters is the perfect status that he achieved in the end, not what happened in the beginning, for deeds are judged by how they end. Allah, may He be exalted, created man and brought him forth from his mother’s womb not knowing anything, then He taught him and brought him from a state of imperfection to a state of perfection. So it is not permissible to evaluate anyone on the basis of what he did before attaining a level of perfection; rather what matters is the state of perfection with which he ended. Yoonus (blessings and peace of Allah be upon him) and other Prophets ultimately attained the most perfect condition.
End quote from Majmoo‘ al-Fataawa (10/299)
See also questions no. 42216 and 7208.