Luckily, neither Sophie nor Agatha dies in the film, thanks to true love’s kiss. What?! Yes, Agatha kisses Sophie to revive her, proving that a friend’s love is just as powerful, if not more, than the love of a romantic interest. Agatha’s kiss opens a portal back to Gavaldon, so the two friends head home, and Agatha leaves her crush, Tedros, behind.

Source: https://www.distractify.com/p/who-does-agatha-end-up-with-the-school-for-good-and-evil