Abdullah bin Amr came to us on pilgrimage, and I heard him say, "I heard the Prophet ﷺ say, 'Allah does not take away knowledge by snatching it away from people after He has given it to them. Rather, He takes it away by taking the souls of the scholars along with their knowledge. What remains is a people who are ignorant. They are asked for religious verdicts and they give verdicts based on their own opinions, so they go astray and lead others astray.'"I related this to Ayesha, the wife of the Prophet ﷺ. Then Abdullah bin Amr came on pilgrimage again, and Ayesha said, "Son of my sister, go to Abdullah and verify for me what you reported to me from him."So I went to him and asked him, and he related it to me just as he had related it the first time. I returned to Ayesha and informed her. She was amazed and said, "By Allah, Abdullah bin Amr has indeed memorized it well."
حج علينا عبد الله بن عمرو، فسمعته يقول: سمعت النبي ﷺ يقول: إن الله لا ينزع العلم بعد أن أعطاهموه انتزاعا، ولكن ينتزعه منهم مع قبض العلماء بعلمهم، فيبقى ناس جهال، يستفتون فيفتون برأيهم، فيضلون ويضلون. فحدثت به عائشة زوج النبي ﷺ، ثم إن عبد الله بن عمرو حج بعد، فقالت: يا ابن أختي، انطلق إلى عبد الله فاستثبت لي منه الذي حدثتني عنه، فجئته فسألته فحدثني به كنحو ما حدثني، فأتيت عائشة فأخبرتها فعجبت فقالت: والله لقد حفظ عبد الله بن عمرو.
Bukhari related it in the Book of Holding Fast (7307) and Muslim in the Book of Knowledge (14:2673), both of them through Ibn Wahb, from Abdul-Rahman bin Shurayh, from Abu Aswad, from Urwa, who mentioned it. The wording given here is Bukhari's.