Happens to me, as well. I believe what you're describing may fall into the category of what's called "depersonalization", and if I'm correct, it is considered a "panic reaction", even though not necessarily the same as what's commonly understood as a "panic reaction".
I see it as a way to escape without escaping--of escaping inward, and cutting oneself off from a dangerous environment.
Have you ever been diagnosed with agoraphobia? I wonder--I have.
It's often hard for me to remember what I've come for, or for matter to think clearly at all. Everyone's a potential threat, I tense, which is a self-fulfilling prophecy, because everyone naturally notices someone tense.
I used to be followed around by a squad of security guards whenever I entered a store. At least that's improved. Someone so tense and "on alert" is naturally assumed to be up to something nefarious, of course. But that scenario played out, snowballing into a "fight/flight" response, causing me to dash from stores, more than a few times, with security in pursuit, and stopping me.
It would be comical--except that it's not. Not when you're there. I understand completely.
I've learned to control it somewhat, to the point that I can pass relatively unnoticed (being 6'4" doesn't help). But even now, upon speaking to anyone, my vocal tension is obvious, making others obviously uncomfortable, bordering on concern.