Many times an allegation is put forth that because Prophets, Khalifas, or any other religious figures have a wrong scientific view than the religion must be wrong however this is false. To illustrate this we will cite an example on an allegation.
Allegation: The founder of Ahmadiyya Jamaat was not satisfied that the inoculation possessed any benefit.
Response by Alhakam.org:
Referring to the first reason, the opponents assert that the Promised Messiahas was not satisfied with the inoculation for plague because he was unaware of how a vaccine works. They refer to an extract of the Promised Messiahas in which he disagreed with injecting oneself with the inoculation, as the inoculation contained traces of the plague vaccine.
The opponents should bear in mind that the Promised Messiahas claimed to be a messenger of Allah Almighty. He was sent in this world for spiritual and moral reformation of mankind. He was not sent as a scientist or someone with mere worldly knowledge. We can easily understand this fact from an incident mentioned in and hadith.
Hazrat Musa ibn Talhara narrates that, “The Messenger of Allah, peace be upon him, and I passed by some people who were at the top of date palms. The Holy Prophetsa said, ‘What are these people doing?” They replied that they were pollinating them and putting the male with the female so that it would bear fruit. The Holy Prophetsa said, ‘I do not think that it is of any use.’ [The narrator states that] the people were told about it, so they stopped doing it. As a result, the trees did not bear any fruit. When the Holy Prophetsa was told about this he said, ‘If it had benefited them, they should have continued their practice. I only expressed a thought. Do not blame me for what I say based on my own thoughts [i.e. do not follow an assumption]. But if I express something to you from Allah, then follow it, for I never tell lies about Allah, the Glorified and the Exalted.’” (Sahih Muslim, kitab-ul-fazail)
Hence, the Holy Prophetsa expressed his own opinion about the pollination which proved unproductive because he was not an agriculturist. The hadith explains that only divine commandments are free from imperfection. Likewise, the Promised Messiahas commented on the plague vaccine with his own knowledge and view, it was not revelation from God. Thereore raising such an allegation is very shallow.
From this example it can be surmised that Divine Wahi is never wrong however opinions based on one's one knowledge can be wrong as that knowledge is predicated on the society around it.