Saul got in trouble for (a) visiting a witch; (b) conjuring, via the witch, the ghost of Samuel (not Elijah, who wouldn’t be born for another 400 years); for the purpose of (c) telling Saul’s fortune. So he had three strikes against him, none of which were merely for communicating with Samuel. If any sort of communication with the dead were evil, Jesus set a terribly bad example for us by doing it himself in the presence of his three principle disciples.
You make a good point about the Transfiguration. However, Jesus can do all sorts of things we can’t. Since he is God, communicating with the dead is hardly a sin. God can presumably communicate with departed souls without sinning.