Many years ago, my high school creative writing teacher Mrs. Brennan suggested that a classmate change the gender signifiers of his male character to female. This was emphasized as a way to reveal cliche, boring characters.
It was good advice for a high school writing class. I still use it when I find myself confused about a character's motivation. Complex characters have complex identities. Gender and sexual identity are unique to the individual you wish to introduce to the world. These interests and impulses influences how a person approaches nearly every situation. Sometimes, switching gender of a character can show me how to add depth and color to their identity.
However, this technique is not a band-aid for lazy characterization. Bold women are not basic men. Weak men are not soft women. It takes more to represent a unique place on the gender spectrum than creating a woman or man and swapping their bathroom assignment. Without added character development, the storyteller risks overlooking opportunities for complexity.
The most obvious example is the massive societal pressures to conform to gender and sexual identity expectations. From birth, little girls in western culture are inundated with pink and boys with blue. There are bikinis for toddlers and plastic guns for boys. Teenage boys must be aggressive in all things while teenage girls must walk the thin line between slut and prude. It continues into adulthood; men want ladies, women want babies. Society offers two buckets to choose from, except you don't get to choose. These pressures influence a range of choices, preferences, fears, and hopes every day, all around us. To fail to account for these influences when switching a character's gender is madness.
Switch your character's gender if you aren't happy with their story arc. Explore what it meant for them to grow up in the society you have envisioned. Allow them to live out in your mind the challenges they faced and then describe the person they came to be in your story. Just don't expect changing the gender of your character will magically add interest.