It is reported that Al-Shaʿbī – Allāh have mercy on him – said:

Stay away from the sinful amongst the scholars and the ignorant amongst the worshippers, for these two are the calamity of everyone who would fall into fitnah.

Al-Bayhaqī, Shuʿab Al-Īmān ḥadīth 1753.