I think the ending is written so that if the ending kills you, you still win. Is this on purpose?
Indeed, I thought it would be frustrating to get to the boss only to lose in a tie.