I like how Sonic the Hedgehog 3 handles its Tragic Villains

Tragic villains are very easy to get wrong. One thing most stories get wrong with tragic villains is how post-Freudian Excuse reveal, they're suddenly portrayed sympathetically, and they either reform with no karma for their crimes, or they sacrifice their lives so they don't have to face justice for them. Very often, their sympathy would go out the window when they intentionally hurt even people that had nothing to do with their start of darkness, regardless if they were a threat to them or not. Sonic 3 has two tragic villains, and I feel they were written pretty well.

First, we have Gerald Robotnik. Just like in the games, his fall to villainy was a response to losing Maria, but unlike the games, he's actually alive in the present day to be a threat. He built the Eclipse Cannon specifically to destroy the Earth under the guise of merely destroying G.U.N., and he manipulates both Ivo and Shadow to achieve it. His love for Maria is genuine, as we saw him crying after she was killed, but he ignores Shadow's pleas that Maria wouldn't have approved of this, and when even Ivo suggests that destroying the Earth may be going too far, he tells Ivo that he's "no Maria." By the end of the movie, he doesn't die regretting what he did or sacrifice himself to undo his own damage. He was a once good man who ultimately died a monster.

Then we have the other tragic villain, and that's Shadow. Just like in the games, Shadow was motivated by the death of Maria, who showed him kindness while he was being used as a science experiment. Throughout the movie, his sole motivation was to destroy G.U.N., but his wrath begins and ends with them. When he critically injures Tom after mistaking him for Walters, he has a moment of hesitation before rationalizing what he did. It was that one subtle action that would have redeemed the "That was his mistake" moment from Big Hero 6. However, he stops making excuses for his behavior when he learns that Gerald wants to destroy all of humanity. He knows that Maria was a caring person and would definitely not have approved of this, but Gerald shoots him down. By the end of the movie, he seemingly sacrifices himself to stop the Eclipse Cannon, only for the Post-Credits Scene to reveal he's alive. This could give him a chance to make amends with Tom for injuring him. It helps that unlike most tragic villains, Shadow didn't kill anybody.