The Messenger of Allah ﷺ said, "Allah does not take away knowledge by snatching it from people, but rather He takes away knowledge by taking the scholars, until, when no scholar remains, people take ignorant ones as their leaders. They are asked questions and give rulings without knowledge, so they go astray and lead others astray."
حدثنا هارون بن إسحق الهمداني حدثنا عبدة بن سليمان عن هشام بن عروة عن أبيه
قال رسول الله ﷺ إن الله لا يقبض العلم انتزاعا ينتزعه من الناس ولكن يقبض العلم بقبض العلماء حتى إذا لم يترك عالما اتخذ الناس رءوسا جهالا فسئلوا فأفتوا بغير علم فضلوا وأضلوا
Agreed upon. Muslim also narrated it, in the Book of Knowledge, chapter on the raising up of knowledge and its withdrawal and the emergence of ignorance and turmoil at the end of time, hadith 2273, from the hadith of Abdah, and Bukhari, hadith 100, from the hadith of Hisham bin Urwa with the same wording.On this topic there is also a hadith from Ayesha [coming next: 2652b] and Ziyad bin Labid, in Ibn Majah, hadith 4048, and Tirmidhi, hadith 2651.The hadith of Zuhri was narrated by Nasai in Al-Kubra, hadith 5908.