Well, there's happy endings and happy endings.
When Robin Williams was making Mrs Doubtfire there was studio pressure to conclude the story with a reconciliation of the divorced parents and a restoration of the broken family unit.
Which probably would have prevailed (as the same reconciliation fantasy did in both versions of The Parent Trap) were it not for the star's resistance and support for the argument that it offered a dishonest promise to any child in the same position.
It's more truthful - and therefore better art - to point to the kind of happiness that you can credibly look for in any dramatic situation. Despite the stage being littered with bodies I think that Hamlet has a happy ending - thanks to the hero taking action, bad stuff gets put right.
Sacrifice of the hero for positive effect has a long and distinguished history.
Plays hell with the prospects for a sequel, though.