A certain person (who shall remain uncredited) commented that if Lo Yilbash was about preventing the intermingling of men and women (as some commentators argue), why does the Torah call the act itself a “To’evah” (Devarim 22:5)?
Rather, it appears the Torah deems the confusion or loss of personal identity as an abomination, just like the perversion of weights and measures (ibid. 25:16), even if this doesn’t lead to anything else. (Sodomy is also referred to as a To’evah, although far more severe, perhaps also for a similar reason.)
This also partially explains the logic of cross-dressing on Purim (contra the Bach). Since it’s a joke (one could even argue that it is the extreme opposite of gender “confusion”!), it’s not part of the prohibition.
All this needs further study of course.