Hilchos Lashon Hara chapter 8, section 9
It is forbidden to insult and curse the dead. The poskim (halachic authorities) wrote that there is an early enactment and ban not to spread slander and a bad name about the dead. All this applies even if the dead person was not learned in Torah. And if he was a Torah scholar, shaming him is certainly a serious sin, and it deserves niddui (being put in excommunication).
The prohibition of shaming a Torah scholar applies even to shaming the scholar himself, and all the more so it is forbidden to shame his Torah teachings.