Also viewers should keep in mind that there are comedies where the bad character being treated as good is deliberate as a form of critisism against their society or if the writers are feeling particularly sarcastic by having them being treated as heroic by the narration as well and actually wanting the audience to disagree with it.
Note: In-Universe examples or Intentional ones go to Nominal Hero or Evil Hero.
Accidental Heroes do accomplish heroic things, but not intentionally.
If the character is publicly perceived as a Hero, but is still shown to be villainous within the narrative context of the work, then he's a Villain with Good Publicity.
Some are meant to walk in the grey line with the author letting the audience decide on their own about whether a character is good or evil and keeping a truly neutral stance.