Just had this exact issue too of dying at the same time as defeating the last enemy and the game soft locking.