When Rav Nahman warns people about Torah scholars that are demons, clearly he is following the strict letter of the Law. One can and must warn people about possible danger to their physical, mental, or spiritual well-being.
[In ליקוטי מוהר''ן I:8 RN goes into detail about the Rav of the Kelipa [the Rav of the Dark Side]
Later in I:12 Rav Nahman goes more in depth about the problem of the תלמיד חכם שד יהודי the Torah scholar that is a demon. And it is clear there that he is talking about people that learn and know the Talmud well. The only problem is that their learning Torah is for the sake of honor or money.