Callie was having a rough time during the Season 12 finale of Grey's Anatomy. She lost custody of Sofia and broke up with Penny who's now living on the other side of the country. Callie was feeling sad and lonely to say the least and Arizona knew it. Having won the custody battle Arizona could've just left Callie in her misery and moved on but Arizona is a good person and couldn't do that. Instead Arizona extended an olive branch to Callie in the form of Sofia and a plane ticket.
Arizona tells Callie to go to New York and bring Sofia back next weekend. Arizona will have Sofia for the summer and Christmas, they'll trade off school years, and then figure out the rest later. In other words, Callie can go be with Penny in New York and still be with her daughter, which is exactly what she wanted in the first place. Thus, Callie still gets her happy ending and Arizona is happy, too. The only people that may not be happy are Grey's fans that don't want to see Callie, or Sara Ramirez, go.
With Callie heading to New York, one has to wonder if she'll be returning for Season 13. Unfortunately, Sara Ramirez confirmed on May 19, via Twitter, that she will not be coming back for Season 13.
Although Ramirez loves her Grey's family she will be taking time off after this season. Ramirez has been on the show for the past decade and the show will feel a different without her but we hope that this departure won't be forever. Unlike other characters that have left the show, Callie wasn't killed off, which means there's definitely an open door for Ramirez to return.
Plus, Penny's fellowship isn't a permanent thing so she may return to Grey Sloan at some point, which means Callie would return as well. No matter what happens we hope Ramirez and Callie return to Grey's someday. We'll miss her deeply.