I do this with family too.
Our natural accent is a mix of the many places our family has lived and a fair few words that have stayed with us that most people don't use. It's ours and we love it. But I don't expect other people to know that.
When on the phone or a zoom with everyone, we'll drop into the natural accent. It's especially bad when we get drunk and do so. My SO has had a time learning 'us', and we've added some of their familys' ticks too. I guess it evolves with each person that comes in.
I had a friend in college from Boston's South Side and when he was drunk and on the phone back home, he was unintelligible.
I agree with calling this 'code switching', but to me (and maybe I'm alone here) that sounds a bit, I dunno, negative. Like I'm being forced to speak in a manner that I don't want to because of money. That's not it.
I speak with my family in a way that is a bit more private. We have our own little thing that outsiders aren't a part of. It's not exclusive by any means, but we're not worried about being understood. I think my family understands that a more common form of communication is needed for the rest of the world.
Actually, you know, we do call the form of English we use at work 'Cash English'. So, I'm full of BS here, maybe.