I am trying to remember a film I saw as a child where at the very end (I think), a boy who I think is the main character is turned into a princess (or maybe a queen). It turned out that he was always a princess and was transformed for some... purpose. I think it might have had to do with protecting her.
His caretakers want to transform him back, but he resists the idea at first. They eventually convince him (or he may have had no choice at all), and he transforms.
The scene is kind of bizarre and shows the character suddenly a woman wearing a flowing dress. I think the scene was outdoors in a garden.
Unfortunately this is all I remember of this movie and I am not sure reliable the details are.