You're likely thinking of Big Trouble in Little China (1986). In the film, the sorcerer Lo Pan transforms the protagonist, Jack Burton, into a woman as part of a ritual to harness Jack's "yang" energy and resurrect his long-dead bride. This serves as a classic comedic exploration of gender roles and power dynamics. While not the only film with this premise, it's the most well-known example.