Sahih Muslim 2673a
'Abdullah b. 'Amr b. al-'As reported Messenger of Allah ﷺ as saying: Verily, Allah does nit take away knowledge by snatching it from the people but He takes away knowledge by taking away the scholars, so that when He leaves no learned person, people turn to ignorant as their leaders; then they are asked to deliver religious verdicts and they deliver them without knowledge, they go astray, and lead others astray.
حَدَّثَنَا قُتَيْبَةُ بْنُ سَعِيدٍ، حَدَّثَنَا جَرِيرٌ، عَنْ هِشَامِ بْنِ عُرْوَةَ، عَنْ أَبِيهِ، سَمِعْتُ عَبْدَ، اللَّهِ بْنَ عَمْرِو بْنِ الْعَاصِ يَقُولُ سَمِعْتُ رَسُولَ اللَّهِ ﷺ يَقُولُ " إِنَّ اللَّهَ لاَ يَقْبِضُ الْعِلْمَ انْتِزَاعًا يَنْتَزِعُهُ مِنَ النَّاسِ وَلَكِنْ يَقْبِضُ الْعِلْمَ بِقَبْضِ الْعُلَمَاءِ حَتَّى إِذَا لَمْ يَتْرُكْ عَالِمًا اتَّخَذَ النَّاسُ رُءُوسًا جُهَّالاً فَسُئِلُوا فَأَفْتَوْا بِغَيْرِ عِلْمٍ فَضَلُّوا وَأَضَلُّوا " .