I heard the Messenger of Allah ﷺ say, "Allah does not take away knowledge by taking it away from the servants' ˹selves˺, rather he takes it away by the passage of the scholars until none of them remain. The people will take as their leaders ignorant persons who when consulted will give their verdict without knowledge. So they will go astray and will lead the people astray." (Using translation from Bukhārī 100)
"إِنَّ الله لَا يَقْبِض الْعِلْمَ انْتزاعا يَنْتَزِعُهُ مِنَ الْعُلَماء ، وَلكِنْ يَقْبِضُ الْعِلْمَ بِقبضِ الْعُلَمَاءِ حتَّى إِذَا لَمْ يُبْقِ عَالِمًا. أَتَّخذ النَّاسُ رءُوسًا جُهّالًا فَسُئِلوا فَأفْتَوْا بِغيرِ عِلْمٍ فَضَلُّوا وأَضَلَّوُا".