I don't think there's anything wrong with leaving a marathon-length interview if you realize in the middle that neither party will benefit. HOW you make your exit is probably key and very important if you don't want such hostile reactions. It might be best to say something very polite such as
Before we continue the next phase, I'd like to say thank-you for all of the time you've spent this morning. At this stage in the interview, I feel that it would not benefit either of us to continue the process.
Or something like that. If the interviewer spazzes out, I think that is quite unprofessional. Would they prefer you to stay all day only to hear at 4 pm that you decided 5 hours ago that the whole exercise was pointless? I wouldn't like that if I were the interviewer.