It seems like you've made a confusing mess of the situation.
I've stopped interviews prematurely before, but never where I actually wanted to interview again with the same company, and still had a variety of questions!
You clearly could have salvaged the interview. You could have soldiered on with the difficult assessment (whilst performing poorly), or you could have accepted the reasonable offer to move on to discussing the skills you do have.
Sometimes a hiring manager will realise he doesn't want you for the role at hand, but for a different one instead. That is besides the possibility, which you already acknowledge, that the assessment was just a standard device, the results of which the hiring manager isn't particularly vested in.
Indeed, you could have asked the hiring manager, "is this technology representative of what I'd be doing in the role, or is it a standard assessment?". That would put him on the spot, and if he said the technology was essential to the role he had in mind (and if you have no intention of re-learning it), then you'd be on much stronger ground to ask to end the interview by mutual consent, or to ask why he believes it is worth proceeding further.
If you were offered another interview in future, you would just ask the question directly beforehand: "will there be an assessment during this interview, and will it involve any specific technology?".
It would definitely pay to be less impulsive in future. If an interview starts centring around a technology you aren't familiar with recently, it shouldn't be a problem to just admit that you're no longer familiar with the technology, without becoming flustered.
Also, if you haven't interviewed in a while, it usually doesn't hurt to just practice receiving questions and giving answers, even if the interview is already fatal in your mind.