Avos Derav Nosson (36:5) These seven have no share in the World to Come: the scribe, the schoolteacher, the best doctors, the city judge, the magician, the sexton, and the butcher.
Shabbos (139a) It was taught. R. Jose b. Elisha said: If you see a generation overwhelmed by many troubles, go forth and examine the judges of Israel, for all retribution that comes to the world comes only on account of the Judges of Israel, as it is said, Hear this, I pray you ye heads of the house of Jacob, and rulers of the house of Israel, that abhor judgment, and pervert all equity. They build up Zion with blood and Jerusalem with iniquity. The heads thereof judge for reward, and the priests thereof teach for hire, and the prophets thereof divine for money; yet will they lean upon the Lord, etc
Kiddushin (82a) The best of doctors are destined for gehenna, and the worthiest of butchers is amalek's partner
Rashi (Kiddushin 82a) 'The best of doctors are destined for gehenna' - They do not fear disease. They eat the food of the healthy, and they do not act humbly before God. Sometimes they kill, and sometimes they are able to heal a poor person but do not do so.
Sheailas Yaavetz (# 71) This that you view the statement in Avos DeRabbi Nosson as difficult as smoke in the eyes or vinegar to the teeth since it says that a person who renders judgements and decides halacha has no Olam Habah. I have previously explained this in my commentary to the Talmud. It simply means that these seven have no Olam Habah only when they don’t do their jobs properly, which in fact most of them do in fact act properly.