Granted, there are a lot of bad tech interviews out there (asking about algorithms that nobody ever uses) ... but I do not understand this. Imagine someone's being hired for a front-end position, and we don't have months to get them up to speed. I'm going to ask them to explain how a closure works. How they deal with AJAX. What they think about "!important". Things to be careful about with floats. How CSS precedence/…
No, the examples you listed are very different settings. An interview is far from a casual conversation, no matter the tone of your voice. An outsider is trying to prove themself to the group, they are under direct scrutiny at all times. One mistake can widely swing the interviewer's impression and cost them the job. No matter how many times you tell them to relax, certain people get into a feedback loop and it freezes them into inaction. Once part of the team being criticized for their code from other developers or clients is much less stressful, it's something they're ready to deal with. They are held with a certain level of respect for even being part of the group at all, and much less likely to lose the job/get fired in such a setting so the stakes are nowhere near as high.