Jesus said he came for the lost sheep of Israel.
He answered, I was sent only to the lost sheep of the house of Israel.
biblehub.com
Actually Jesus said he was sent not came. But to your point, context is everything. She was a woman and in those times women were not treated as equals by most men. She was a gentile and in those times gentiles were looked down upon by most Jews. So she had two strikes against her. This is the context for what happened next. So this gentile woman comes to Jesus and pleads for her daughter. Jesus doesn't respond to her at all. His disciples come in and asked Jesus to send her away because she keeps pestering them. After all she was just a woman and she wasn't even Jewish. So what does Jesus do? He tells her he was sent only to the lost sheep of the house of Israel. Does this dissuade her? No. She then pleads with Jesus to help her. What does Jesus do? He says in a very disrespectful way “It is not right to take the food of the children and throw it to the dogs.” Does this dissuade her? No. She says, “Please, Lord, for even the dogs eat the scraps that fall from the table of their masters.” And how does Jesus respond to this? He tells her, “O woman, great is your faith! Let it be done for you as you wish.” And he healed her daughter.
The exchange had to occur in this way to prove the point that faith matters. It was a teaching moment for the disciples and for us.
The Canaanite Woman’s Faith.*
21
i Then Jesus went from that place and withdrew to the region of Tyre and Sidon.
22And behold, a Canaanite woman of that district came and called out, “Have pity on me, Lord, Son of David! My daughter is tormented by a demon.”
23But he did not say a word in answer to her. His disciples came and asked him, “Send her away, for she keeps calling out after us.”
24
* He said in reply, “I was sent only to the lost sheep of the house of Israel.”
25
j But the woman came and did him homage, saying, “Lord, help me.”
26He said in reply, “It is not right to take the food of the children
* and throw it to the dogs.”
27She said, “Please, Lord, for even the dogs eat the scraps that fall from the table of their masters.”
28
k Then Jesus said to her in reply, “O woman, great is your faith!
* Let it be done for you as you wish.” And her daughter was healed from that hour.