You reminded me of one of the first interviews I ever had in tech. I took 2 phone screens, and a take home assignment. Last step: Zoom interview with some of the IT team (3 people). It started well, but I slowly started panicking. All three of them were shooting questions at me, which I answered them all correctly, as far as I know, but I was so... cold. Started stammering my words and speaking like a terrified child at the principals office.
I could observe myself and knew what I looked like, but couldn't break it. The CTO stopped me as I was speaking and said "this isn't going to work". As soon as he said that, I ended the call. I had some major imposter syndrome during that time, I think that played a huge role in my fumble. Still massively cringe when I think about that, though.
That's just a tech version of the age-old hostile (panel) interview.
I don't think it's a useful interview practice, at least in tech, below director level, but you just have to keep your composure and gently assert control. If that CTO favored it maybe their company culture was unusually aggressive.
tbf it sounds like you might have dodged a bullet there, so try to not beat yourself up too much for thinking you weren’t good enough.
we all have imposter syndrome when we start out. as long as you didn’t outright obviously lie or something then you probably didn’t do anything particularly wrong that’s worthy of the cringe.
(i’ve done the exact same thing in interviews, most of us probably have some story like that).
Honestly, it sounds to me like the CTO, not you, is the one who should be embarrassed by memories of that experience. Unless being a polished speaker under high pressure situations was a requirement for the job, the CTO, as leader, should have had the skill to make you more comfortable expressing your knowledge and skills.
I have memories of experiences freezing up and losing the physical control required to speak as well, so I have empathy.
(Having such experiences as a child are what led to me joining the high school speech team doing extemporaneous and impromptu events to get over them. I eventually went on to be a regional champion and a state competitor, but I still sometimes have to fight the physical tension when speaking in certain situations).