If you had died, you would have been sent to the entrance of a new dungeon. The ending is working as intended.