Me in various situations:

First date with new chick? Confident AF

House party, assuming I know at least the host? Confident AF

Shop assistant asking me how much chicken do I want? Weird AF

Doctor wanting me to describe what my ailment is? Almost stuttering, using 5x as much words as needed.

Watching my father, as it's probably some genetic thing, he is very, very polite with anyone who is not in his "circle". He loses confidence quickly just like me.

And damn, I have no idea what is the source of this thing, but I'm perfectly sure if I did this stuttering thing next to person I want to talk next, I'd lose all chances in a second.

I have some theories. Maybe I don't want to offend someone? Maybe I'm afraid of that person, of repercussions if I offended this person. Maybe I'm oversensitive, want to be too nice to make someone's day better, to the effect of failure in the end. Maybe it's some defence against being a jerk in general? I can easily imagine myself telling the doctor "look jerk, I know medicine better than you, and since we started talking you did at least 3 medical mistakes" and maybe that is some way to prevent polarization of my behaviour?

Anyways, this is weird problem, so I hope someone had similar behaviour and can tell me what happened? (For those who don't understand what kind of behaviour it is - imagine guy you're talking to is off-duty policeman whose son was buying drugs from you - you will be VERY polite - except this happens also with some not important people with no power over you!)