Rachel assumed that Josephine would change back into Joseph and become her husband. But that's not what happened. Instead, Rachel found herself suddenly attracted to both of the genies. She had inadvertently turned herself into a lesbian ... a married lesbian. Rachel looked at Josephine, a smile appearing on her face despite the weirdness of the situation. Josephine, now her lesbian wife, smiled back.
But that wasn't all that happened. Genie was now Rachel's lesbian wife too. Genie had gotten what she wanted. She wanted to be free of the lamp, and that's what Rachel's wish had done. After all, you couldn't be married to a genie. So the magic had changed Josephine and Genie into human females. They could no longer use magic, and without the presence of a genie or genies, the magic lamp turned black, then disintegrated into a pile of ash.
Josephine, because of a previous wish, could still change herself back into Joseph, but now she wasn't sure she wanted to. Because of Rachel's wish, she now had memories of growing up as a female and it felt weird wanting to be male. And she could never do that to her wife. Rachel was a lesbian, like her (and Genie too), so she would be just as weirded out about Josephine turning male as she herself would be. No, she was going to stay female and live her happy life married to both Rachel and Genie. She knew the neighbors didn't approve of their three-way lesbian relationship, but she didn't care. As long as they loved each other and they weren't harming anyone, what did it matter what the neighbors thought?