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 lives of 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."
حدثنا وكيع أخبرنا هشام عن أبيه
قال رسول الله ﷺ إن الله لا يقبض العلم انتزاعا ينزعه من الناس ولكن يقبض العلم بقبض العلماء حتى إذا لم يبق عالما اتخذ الناس رؤساء جهالا فسئلوا فأفتوا بغير علم فضلوا وأضلوا
Its isnad is sahih, and it is a repeat of 6511. "Yanziuhu" appears this way in H and M, while in K, and in a copy in the margin of M, it appears as "yanzighuhu," which agrees with the previous narration.