Yeah so, your goal is still to win, just you need your memories first. You get a "different ending" if you kill him before restoring your memories where the narrator says Resfin can no longer stop you from wrecking havoc etc. Not perfect but that's the challenge of the theme :) The loss of upgrades after an extra death was not intentional, sorry about that! Commonly reported bug.