Your second paragraph seems to be suggesting that Foucault and Butler's idea is wrong because of their sexual orientation. This seems both unjust and irrational. If you believe the distinction has no scientific merit, you could cite or propose relevant studies. If you believe it has no cultural merit, you could discuss how the distinction functions in society.
Why? As a rule of thumb, humans start thinking about something when it doesn't work for them. And for gays in particular, the traditional structuring of gender roles has been deeply problematic, indeed even today there are many countries where gay sex is illegal. So it's no surprise that homosexuals have though more deeply about gender and its relationship with sexuality than those for whom it works.
Foucault is intersting. In contrast, Butler's work is weak. She really doesn't have a meaningful handle on the relationship between sex and gender.
> Your second paragraph seems to be suggesting that Foucault and Butler's idea is wrong because of their sexual orientation.
That's not how I read it. I read it as, Foucault and Butler's idea is unproven because it's based off of their anecdotal experience rather than based off of any scientific evidence.
I don't see where GP claims that the idea is wrong: they're simply pointing out that it's a relatively recent distinction, which implies (reasonably, IMHO) that we likely don't understand it very well yet, or that it may ultimately not be a meaningful distinction to draw once we better understand the underlying mechanisms.
Perhaps near-future advances in genetics and neurology will expand our definition of biological sex to explain gender identity. In that case, our current sex vs. gender distinction would simply be another way of saying "we don't understand how this works yet". There's a lot of this "transitional stuff" in science history, where we have credible anecdotal evidence that our previous understanding is wrong but don't yet know how to coherently explain it. (See: Greek attempts to explain the nature of matter; the infamous cholera map by John Snow; etc.)
That doesn't make the "transitional stuff" wrong: an idea doesn't have to have solid theoretical underpinnings to have merit. It does, however, mean we should continue searching for an explanation.