Is this insensitive to the trans community?

Part of my SO's job is asking his financial clients certain questions that they can choose to answer yes, no or decline all together. but that are put in place by the government to assure fair financial practices. One of those questions is "are you a male or a female?"

Knowing that the government doesn't account for other genders on this questionnaire, male and female are the only two options in this scenario.

Every time he asks that question he would say "the last time you checked, are you male or female?" And he continued doing it for years bc he would get a chuckle out of his clients. So I finally convinced him to stop phrasing it that way because it might offend someone. he agreed it was a dumb joke and not funny anyways even if his clients usually chuckle.

Tonight he said "I still ask it when I'm on the phone with a couple and I'll say "bob, the last time you checked, was meg a male or female? It makes them laugh."

So again I explained that it's insensitive and while he might not have offended someone yet, its inevitable that he will. And he agreed he would stop and come up with a different dumb joke that's less likely to hurt someone, being that a lot of people at least know and care about someone who is trans.

Do you think phrasing that government question like that is insensitive?