Consider submitting (or adding to) a bug report, because I think a few things went awry there, but unfortunately unpacking the rules in that exact situation can be tricky. You might argue that you technically finished the stage, submitted a time, and then retired, but no matter how the game determined you to have retired, it then failed to take away all your damage to allow you to continue, which is the point of you coming here to ask that question.