"Besides," said Jamie, "how would it look if my older sister carried me into the costume party?"
Whoops. Karyn had, after all, said they were going to a costume party. So they were! And why did Jon think he was Jamie?
"We're not going to a costume party. You remember being Jon. And from now on your memories won't be altered by any changes I make unless I say otherwise and mean it." That would prevent any accidental memory changes, like referring to her as Jamie and having the magic decide that that counts as permission to alter her memories.
"Wow," said Jamie. "So now everyone thinks I'm your sister Jamie. But I don't want to be a girl."
"Let me change you back then. You're Jon now."
Jamie transformed back into Jon.
Then Karyn said "Let me try something. You do want to be a girl named Jamie."
"I..." said Jon. "You know, I really do want to be a girl. I didn't want to be a girl a minute ago, but now I do."
"Of course," said Karyn. "What kind of girl should I make you into?"