It's unjustified to attempt derogatory jokes by irrationally insulting people.
It's always disappointing to hear that from friends, family, or just a fictional character, especially when it's not anticipated. If people let bigotry concealed as comedy go unchecked, that discriminatory attitude will just spread to more people. The chance to eliminate such a discriminatory attitude requires a direct confrontation about it.
So, it's bad to call people "transgendered."
That is an insulting slur which can't be obscured by contextualizing it.