How can it be that the Prophet (peace be upon him) made mistakes, as clearly mentioned in the Qur’ân, and at the same time be infallible?
The Prophet (peace be upon him) is infallible, divinely protected from error, in everything that he relates to the people from Allah.
Allah says: “Nor does he say aught of his own desire. It is no less than inspiration sent down to him.” [Sûrah al-Najm: 3&4].
Allah says: “And if the Messenger were to invent any sayings in Our name, We should certainly seize him by his right hand. And We should certainly cut off the artery of his heart. Nor could any of you withhold him (from Our wrath).” [Sûrah al-Hâqqah: 44-47].
There are numerous other evidences that the Prophet (peace be upon him) is infallible in what he relates to us from his Lord. He would never do anything in contrary to what Allah commands, whether intentionally or by mistake.
The Prophet (peace be upon him) was allowed to forget some verses, but not a total forgetfulness. He would forget for some time due to his being human. Allah says: “By degrees shall We teach you (The Message) so you shall not forget, except as Allah wills, for He knows what is manifest and what is hidden” [Sûrah al-A`lâ: 87]
In certain matters, the Prophet (peace be upon him) was allowed by Allah to exercise his own judgment (ijtihâd). In these cases, he would not be left to err. If he made a mistake in judgment, he was publicly advised about it. That is why he was censured in the Qur’ân regarding his decision about the prisoners of Badr, his behavior towards `Abd Allah b. Umm Maktûm (in Sûrah `Abasa), and regarding Zaynab b. Jahsh and Zayd b. Hârithah, where Allah says: “But you did hide in our heart that which Allah was about to make manifest.”[Sûrah al-Ahzâb: 37]
Despite the fact that these verses were criticizing him, the Prophet (peace be upon him) declared these verses to people, and did not care what the unbelievers and hypocrites would say.
For the Prophet (peace be upon him), the religion comes first in importance. This is one of the excellent qualities granted to him by his Lord. Allah says about him: “And surely you are of an exalted standard of character.” [Sûrah al-Qalam: 4]