The Imaginarium of Doctor Parnassus (2009) IMDb
Terry Gilliam (director).
Thousands of years ago, a powerful mystic led a secret society that he thought was necessary for constantly telling a story that sustained the universe by its mere telling. Then the devil came along and interrupted the story, offering the mystic a bet instead, and losing it. In modern-day London, the mystic is losing hope, having been immortal only until quite recently.
References here: The Zero Theorem (2013).