Some people, including heretics, claim that the prophets and messengers might have made mistakes
like all humans, they are liable to err e.g. Cain, the
son of Adam,
murdered his brother
when the two angels came to David (Dawud), he listened to the first and did not listen to what the second had to say, the story of Yunus (John) when the whale swallowed him, and the story of the Messenger with
Zayd ibn Harithah.
They say that he concealed something which he should have declared openly. Similarly, (Part No. 3; Page No. 264) he once said to some of his companions, “You know better about your worldly affairs,” after giving advice that proved harmful, thus he made a mistake in this regard. His account with the blind man as referred to in the Ayah:
(The Prophet صلى الله عليه وسلم) frowned and turned away.
Because there came to him the blind man (i.e. ‘Abdullâh bin Umm-Maktûm, who came to the Prophet صلى الله عليه وسلم while he was preaching to one or some of the Quraish chiefs).
Did the prophets and messengers really make mistakes? How can we respond to the sinners who say these things?
A: Yes, the prophets and messengers might have made some mistakes, but Allah did not approve of their mistakes. Rather, He pointed out their mistakes as Mercy to them and their nations, forgave their mistakes, and accepted their repentance as Grace and Mercy, for Allah is Oft-Forgiving, Most Merciful. This will be clear to anyone who reads the Ayahs of the Qur'an in which the matters raised in the question are discussed. Moreover, Allah did not reject the declaration of the Prophet regarding the wings of the fly that carry the disease and remedy. Rather, this Hadith is true due to Allah's approval of it.
With regard to the sons of Adam, even though they were not prophets, Allah explained how evil the misdeed he unjustly committed against his brother was! Moreover, our Prophet Muhammad (peace be upon him) showed the outcome of this act, as he said,
Whenever a person is murdered unjustly, there is a share from the burden of the crime blamed on the first son of Adam for he was the first to commit a murder.
May Allah grant us success. May Peace and blessings of Allah be upon our Prophet Muhammad, his family, and Companions!