Consider a male athlete who is a reasonably skilled 100 metres sprinter, with a best time around 10.3 seconds. Probably not enough to make a career in track and field, but faster than the women's 100 metres record of 10.49 seconds, enough for him to declare:
What a shame I was not born a woman, for then I would have been a record-breaking champion instead of an amateur.
This reasoning is clearly flawed because if he had been born a woman, he would not have run 10.3 seconds.
I think this mode of spurious reasoning, in which the side-effects of a counterfactual are ignored, is reasonably common in practice, but is there a name or expression which describes it? Either the technical name of this particular fallacy, or a phrase or idiom which alludes to it, would both be welcome.