It is reported that Harim b. Ḥayyān – Allāh have mercy on him – said:

“Beware of the sinful scholar (al-ʿālim al-fāsiq).” This reached ʿUmar, so he wrote to him in fear, “Who is the sinful scholar?” He wrote back, “I did not intend but good; this is when there is an imām (leader, taken as an example) who speaks knowledge, but practices sins, confusing the people, and thus they go astray.”

Al-Dhahabī, Siyar ʾAʿlām Al-Nubalāʾ 4:49.