Shaykh al-Islām—may Allah have mercy on him—was asked:
A man studied jurisprudence according to one of the four schools and acquired a thorough understanding of it. He then devoted himself to hadith and encountered authentic hadiths for which he knew of no evidence that abrogated them, restricted their general scope, or contradicted them, yet his school’s position differed from them. Is it permissible for him to follow that school’s position, or must he instead act upon the hadiths and depart from his school’s position?
He replied:
All praise is due to Allah.
It is established by the Book, the Sunnah, and consensus that Allah, glorified and exalted is He, has obliged His creation to obey Him and His Messenger, may Allah bless him and grant him peace. He has not obliged this community to obey any particular individual in everything he commands and forbids except the Messenger of Allah, may Allah bless him and grant him peace. Even the most truthful member of this community, and its best after its Prophet, used to say:
“Obey me so long as I obey Allah. If I disobey Allah, you owe me no obedience.”
They all agreed that no one is infallible in everything he commands and forbids