Fairy tales have a lot of gender swap magic and Shakespeare has more than one instance of a principal character spending a conspicuous bit of time on stage disguised as the other sex (IRL women were not yet allowed to go on stage so women's parts were played by men or boys who could pass)
In the Cyberpunk novel When Gravity Fails sex change processes have been reduced from a years-long process to hours (and now intersects with human trafficking).
All this time trans and enby folk are wishing so hard it could be so.
Many examples in older mythology as well. Norse mythology makes reference to genderfluid characters and Greek and Roman mythology are filled with stories of characters’ genders changing for a variety of reasons.
Shadowrun has gender changes as basically a walk in, outpatient procedure in most cases. There's a character in lore that changes their sex every so often just for fun.