The DC Extended Universe film Suicide Squad includes the Joker's girlfriend Harley Quinn as a central character, toying with the question of whether Harley is genuinely "crazy" or merely putting on an act. The film never really answers the question, nor does it get into the issue of what kind of craziness she might even have.
Dr. Harleen Quinzel, the psychiatrist who falls in love with the Joker and then becomes the supervillain (and occasional antihero) Harley Quinn, is something of a social chameleon: More extremely than most people do, she shows personality changes in line with whoever she hangs out with. When she works with heroes like Power Girl, she's more heroic. When she's with villains, she's more villainous. When she's with the Joker, she's more murderous. In and of itself, though, social chameleonism is not a specific mental illness or personality disorder.
A person suffering shared psychotic disorder, originally known as folie à deux (“folly of two”), buys into someone else’s psychosis and takes on, in part or even in whole, the other’s delusional thinking. With nothing in Harley’s history to suggest that she was psychotic before those months in Arkham while the Joker manipulated her, this diagnosis seems possible if she’s really psychotic. Comic book writers vary in how they write Harley and depict her grasp of the reality around her, but usually she understands what is happening regardless of her skewed perspective on it. The fact that she enters the Suicide Squad after having earned a death sentence indicates that her world's legal system has found her legally sane and responsible for her actions.
The Joker himself, who has been treated as legally insane in the comics since the early 1970s, knows the real world implications of his actions. When he kills you, he knows what he's doing, he knows it's considered wrong, and that's part of what's fun about it for him. The Joker defies diagnosis. We don't know what's going on inside his head, and from a storytelling perspective, it's best that way.
So what is wrong with these characters?