My daughter recently convinced me to watch Les Misérables. I've never read it (though I hasten to add in my defense that I have read The Hunchback of Notre Dame, so there!), so had no idea what to expect. I enjoyed it, but my atheism makes happy endings involving the afterlife... well, not so happy. (Not that the ending of Les Mis is all smiles and bubbles anyway!) To me, the ending served as a sorrowful reminder of my Christian hope that my husband would be there to greet me when my life ends, which I now recognize isn't going to happen. In real life, there's nothing to look forward to after the grand finale is sung.
But it makes perfect sense in the context of the movie, so I can watch it as part of the fiction and not grind my teeth too much. In any event, the ending lyrics about how the "wretched of the Earth" will "live again in freedom in the garden of the Lord" serve as a reminder that no, actually, they won't. It's better to work for the betterment of this world than to hope for the mystical light of a world that will never come.