If an employer enumerates distinct garments for males and for females, and if a male employee wears a garment that is classified for the opposite gender, then by definition that male mis due to be construed as a member of the other gender. The dress code thus self-proves the validity of his attire.
Stated less abstractly, if a company’s definition of “male” is someone who does not wear skirts, then one who wears skirts must not be male according to that dress code or else he wouldn’t wear a skirt to work. So if the dress code establishes that he is not “male” then the dress code self-proves that he be permitted to wear a skirt because males do not wear skirts and thus if he is not male according to the dress code, then a skirt is appropriate. I would imagine that skirt-wearing males would not care where they land on the dress codes definitions of male. If such men cared about external opinion….well, they wouldn’t wear skirts.
(This is to say, a gendered dress constructs a gender dichotomy where males are expected wear “masculine” garments and where skirts, dresses, and sandals are regarded as “feminine” so one who wears such things is not “masculine” and therefore not constrained hy the prescribed “masculine” regimen.)