I, too, have sat on both sides of the interview table. From what you're saying, the interview possibly wasn't going badly at all.
As an interviewer, I want to know not just what the candidate can do, but what hethey can't do. Our practice was to take the candidate through histheir comfort zone, and try to get them out the other side. We wanted to see their limits, and we wanted themthe candidate to see them too. (To be fair, we always explained that was what we were doing, so the candidate didn't get discouraged.)
Again, as an interviewer, we knew we were never going to get "perfect" candidates. Someone who was weak in one area might be great in another. We constructed our systems to allow the candidate to show us what they were great at, and tried to give them every opportunity to do that, restarting as many times as necessary.
Thing is: an in-person interview is an expensive thing. The candidate has to travel perhaps some distance, and we're taking some senorsenior people out of productive work to interview them. We didn't take that lightly. Having committed that time and money, we all wanted to get the best possible result.
And finally: remember Winston Churchill's words: "When you're going through hell: keep going".