Hosea was talking about Israel, not a messianic prophecy. Matthew was quoting from Memory.
He was thinking about Jesus leaving Egypt and thought about a similar situation.
Hosea 11
Easy-to-Read Version
Israel Has Forgotten the Lord
11 The Lord said
, “I loved Israel when he was a child,
and I called my son out of Egypt.
2 But the more I[a] called the
Israelites,
the more they left me.
The Israelites gave sacrifices to the false gods
and burned incense to the idols.
3 “But I was the one who taught Ephraim to walk.
I took the Israelites in my arms.
I healed them,
but they don’t know that.
4 I led them with ropes,[c]
but they were ropes of love.
I was like a person who set them free.[d]
I bent down and fed them.
Hosea 11
King James Version
11
When Israel was a child, then I loved him, and called my son out of Egypt.
2 As they called them, so they went from them: they sacrificed unto Baalim, and burned incense to graven images.
3 I taught Ephraim also to go, taking them by their arms; but they knew not that I healed them.