I've had this many times during interviews.
If you had a chat with me through lunch on some technical intensive questions, It would be a breeze. I could not only answer them, I could list limitations, how to address them, and I could even come with a working plan on how I could get it done.
Do the same in an interview, I will freeze.
I feel you.
This is also exactly my problem in interviews, even going back to university, in any oral exams.
I'm often so stressed in those situations, that I forget the simplest stuff and any logical thinking is sheer impossible.
Recently I failed a time-based 5 hour homework, because I couldn't think and overcomplicated my approach.
It is really annoying and frustrating and overall, this made my life soo much harder and more stressful.