It was a miracle of God intervening in his life.
For whatever reason, he was permitted to experience reality over and over and over again, while fully cognizant and fully remembering everything prior.
It's like conscious reincarnation, each day being a new life, only with him starting out as a 45 yro instead of an infant.
After thousands of days, he had successfully traversed from
- infant - not knowing what the heck is going on,
- child - innocent child trying to figure things out,
- teenager - hedonistically having fun, robbing banks, dying, etc.,
- adult - trying to make things right, seeking Enlightenment (piano playing, learning foreign languages, etc.),
- wise sage - a state near enlightenment where only Today mattered and all his desires were overlooked for the benefit of others and the betterment of the world. Rita was a perk, not his sole mission.
In this sense, the movie is a clear indication of the cycle of Reincarnation, albeit one where this individual did not have to be reset continuously inorder to progress.
The ending is him literally breaking out of Maya (illusion), as the Hindus say, and leading a wholly Activated, Enlightened existence, without the need of further reincarnations.