AHMAD-ZUHD 1285:
from Iyyākum —
[Machine] Beware of the corrupt scholar. When Umar ibn Al-Khattab heard about him, he wrote to him and felt sorry for him. What is a corrupt scholar? He wrote to him, "By Allah, O Amir al-Mu'minin, I did not intend anything except for good, that he becomes an imam who speaks with knowledge and acts with wickedness, confusing people and leading them astray."
الزهد لأحمد ١٢٨٥:
عن اياكم —
إِيَّاكُمْ وَالْعَالِمَ الْفَاسِقَ فَبَلَغَ عُمَرَ بْنَ الْخَطَّابِ ؓ فَكَتَبَ إِلَيْهِ وَأَشْفَقَ مِنْهَا مَا الْعَالِمُ الْفَاسِقُ؟ فَكَتَبَ إِلَيْهِ هَرِمٌ وَاللَّهِ يَا أَمِيرَ الْمُؤْمِنِينَ مَا أَرَدْتُ بِهِ إِلَّا الْخَيْرَ يَكُونُ إِمَامًا يَتَكَلَّمُ بِالْعِلْمِ وَيَعْمَلُ بِالْفِسْقِ فَيَشْتَبِهُ عَلَى النَّاسِ فَيَضِلُّوا
hadithunlocked.com