Please don't list this on a work's page as a trope. Examples can go on the work's YMMV tab.
Tear Jerker: Prince of Persia (2008)
The ending breaks your heart — in it the previously cynical, Ineffectual Loner Prince decides to screw over the whole world and release the Big Bad in order to bring Elika back from the dead. It takes its time to play out, and the Prince, who used to have a smart-assed comment for everything, does not say a single word during it. Plenty of people have called it an Ass Pull or Shocking Swerve ending because it basically means that all the work you've done was for nothing, but if you value the character development, it'll tear you up because it is the only way the game could have ended.
Made worse by the Epilogue. Elika despises him, and leaves him to his fate to look for her people.
Even sadder because he did have a really good reason for doing what he did, and it's one of the most unselfish things anyone could ever do. He could have left Ahriman for someone else to deal with, because the Prince will probably be dead and gone by the time Ahriman breaks out again. Instead, the Prince chooses to undo all the work he did and bring Elika back and stick around just so they can find a way to get rid of Ahriman for good. He went through hell, and he's willing to go through it again to keep Elika alive and rid the world of Ahriman's threat. His reward? Elika refuses to listen to him and leaves him, possibly to die, to find her people — you know, the ones who abandoned their duty and inadvertently helped unleash Ahriman in the first place. What the hell, Elika?