السلام عليكم ورحمة الله وبركاته
Al-Darimi reported in his al-Sunan,
أخبرنا محمد بن عُيَيْنَةَ انا عَلِيٌّ هو بن مُسْهِرٍ عن أبي إسحاق عن الشَّعْبِيِّ عن زِيَادِ بن حُدَيْرٍ قال قال لي عُمَرُ هل تَعْرِفُ ما يَهْدِمُ الْإِسْلَامَ قال قلت لَا قال يَهْدِمُهُ زَلَّةُ الْعَالِمِ وَجِدَالُ الْمُنَافِقِ بِالْكِتَابِ وَحُكْمُ الْأَئِمَّةِ الْمُضِلِّينَ
Ziyaad ibn Hudair said: Umar said to me, "Do you know what destroys Islam?" I said, "No." He said, "It is destroyed by the mistake of the aalim and the arguing of the hypocrite using the Qur'an and the rule of misguiding rulers."
There are a number of other reports that indicate the same thing some of them are hadith. The question arises then how are the common people to know when an aalim makes a mistake. The only way they can know that is to refer to the rest of the ulama, so when the ulama are telling them that so and so committing a blunder in saying such and such thing or in holding such and such a position then the laymen realizing that so and so holds an irregular opinion they should not follow him on that. An example of it is Imam al-Ghazzali holding that the Sufis employment of singing and music as a form of worship is legitimate, and another is Imam Ibn Taimiyyah's holding a triple divorce pronounced at one sitting to enact as a single divorce. Al-Suyooti mentioned in al-Durr al-Manthoor that al-Tirmidhi and al-Baihaqi in his al-Asmaa wa al-Sifaat reported from Ibn Umar that he said the Messenger of Allah صلى الله عليه وسلم said,
لا يجمع الله هذه الأمة على الضلالة أبدا ويد الله على الجماعة فمن شذ شذ في النار
"Allah will never gather this ummah in error. The hand of Allah is over the main community, so whoever separates from it will be separate in the Fire.