It appears to be part of Strange’s training and his journey to become who he is supposed to for The Ancient One to treat him as she does in Doctor Strange. Like with what Strange does in Avengers: Infinity War she has looked into his possible futures.
The Ancient One: Do you wonder what I see in your future?
Doctor Strange: No. Yes.
The Ancient One: I never saw your future, only its possibilities. You have such a capacity for goodness. You always excelled, but not because you crave success, but because of your fear of failure.
The conversation continues and shows part of what this part of her teachings were all about for Strange. She is trying to teach him some vital lessons with selfishness just as she is trying to teach Mordo to be more flexible.
Doctor Strange: It’s what made me a great doctor.
The Ancient One: It’s precisely what kept you from greatness. Arrogance and fear still keep you from learning the simplest and most significant lesson of all.
Doctor Strange: Which is?
The Ancient One: It’s not about you. When you first came to me, you asked me how I was able to heal Jonathan Pangborn. I didn’t. He channels dimensional energy directly into his own body.
Doctor Strange: He uses magic to walk.
The Ancient One: Constantly. He had a choice: to return to to his own life, or to serve something greater than himself.
Doctor Strange: So, I could have my hands back again? My old life?
The Ancient One: You could. And the world would be all the lesser for it. I’ve hated drawing power from the Dark Dimension, but as you well know, sometimes one must break the rules in order to serve the greater good.
Doctor Strange: Mordo won’t see it that way.
The Ancient One: Mordo’s soul is rigid and unmovable, forged by the fires of his youth. He needs your flexibility, just as you need his strength. Only together do you stand a chance of stopping Dormammu.
Remember how in Avengers: Infinity War and Avengers: Endgame there was only one winning possibility and Strange couldn’t tell anyone if they were under that play still else it wouldn’t happen. A similar thing is happening here. For Strange to turn into the best of us he must walk a specific path that has The Ancient One giving him a hard time. Of course here that specific path also forms an extra purpose because it helps Strange let go of his own selfishness.
As part of this path she wanted Mordo to battle for Strange, which he does, as Mordo is a vital mentor and it also helps him on his own journey. The Ancient One’s final words in the below quote are quite telling as to what she is actually trying to do here; she is guiding the both of them to become who they need to be.
The Ancient One: Thank you, Masters. You think I’m wrong to cast him out?
Mordo: 5 hours later, he’s still on your doorstep. There’s a strength to him.
The Ancient One: Stubbornness, arrogance, ambition…I’ve seen it all before.
Mordo: He reminds you of Kaecilius?
The Ancient One: I can not lead another gifted student to power, only to lose him to the darkness.
Mordo: You didn’t lose me. I wanted the power to defeat my enemies. You gave me the power to defeat my demons. And to live within the natural law.
The Ancient One: We never lose our demons, Mordo. We only learn to live above them.
Mordo: Kaecilius still has the stolen pages. If he deciphers them, he could bring ruin upon us all. There may be dark days ahead. Perhaps Kamar-Taj could use a man like Strange.