Every so often people will call me my husband's name, and vice versa.
This is even for people who know us quite well!
Embarrassingly, I do the same thing to a number of same-sex couples I know.
Why does this happen somewhat consistently?
First, let's lay out a few observations.
It doesn't happen when I knew the person first as an individual and they met my husband later.
It happens just as often with straight and gay people.
It doesn't happen for opposite-sex couples, even people who have names that could be male or female.
It only happens for long-term couples.
Couples that we know extremely well it stops happening with.
I think what is happening is that how you store an individual is related to how you first got to know them.
If you got to know them as an individual, it's stored in your brain as the individual, then later with a tag for being in a couple.
If you got to know them as a couple, then it's stored in your brain as a couple, with each individual having a little discriminator tag.
For opposite-sex couples, there's an obvious and unambiguous discriminator tag: gender.
Gender is apparently an extremely salient dimension; there's a reason many languages have gender baked into the language so deeply.
This is the reason we don't often realize this encoding operates for couples, because most couples are opposite-sex and so have an obvious and natural discriminator.
For same-sex couples though that discriminator tag doesn't work, and other discriminator tags (e.g. "the tall one", "the one with curly dark hair") are much less salient and require more work.
Once you get to know the individual as an individual (e.g. you spend a ton of time with them), that becomes the primary way you encode them.