True, it did end with him dying.
Though if you think about it, the Palaces (and Sins) are like the journey described in 3301. And over the course of the game, the Phantom Thieve's and their reality was shaped.
They journeyed deep within Mementos, and at the end, they discovered that god had abandoned them.