The geneology highlights how Jesus is the great-grandson of Matthias, which is in parallel to Matthias ben Johanan of the Maccabees (a Kohen, or son of Levi), considered the start of the Hasmonean dynasty. Luke explores the "Light" or "Heli" side of Jesus geneology and how Jesus is to become the new dynasty of God through the priesthood and the Maccabees.
Equally, the Matthew geneology explores the "Israel" or "Jacob" side of Jesus ancestors, making reference to the Babylonian exile and the Jews that were first to return under Zerubabbel. This is Jesus connection to the Tribe of Judah, David, and to royalty in addition to the exile. Both lineage challenge the legitimacy of the Herodian dynasty started by Antipater the Idumean.
I understand your arguments.
My perspective is that the author of Matthew, when addressing the Gospel to the Jews, omitted some generations (for example, Ahaziah, Joash, and Amaziah - 2 Chronicles 21:4-26:23). When in verse 8 it says that Joram begot Uzziah, he was using "begot" in the sense of "was an ancestor of." It is likely that he did this to present a systematic summary of three periods in the history of Israel (the Monarchy, the Captivity, and the Messiah), each with fourteen generations, totaling forty-two patriarchs, as representative of the 42 gods of the NOMOS of Egypt.. Additionally, he included women, which was uncommon in genealogies, especially those of dubious reputation. In the same book, in chapter 2, Jesus is taken to Egypt to escape persecution. It is also stated that Jesus hid in the Tribe of Ephraim due to persecution (Hosea 7:11; 9:8; John 11:54), which recalls the governor of Egypt, Joseph, and the daughter of Potiphera, priest of On (Genesis 41:50–52). Ephraim was born in Egypt.
He also rejected the tents of Joseph and did not choose the tribe of Ephraim; instead, he chose the tribe of Judah and Mount Zion, which he loved. Psalm 78:67-68
The city of Shiloh is one of the most significant biblical locations. The site is first mentioned in the Bible when Joshua erected the tabernacle, where the Ark of the Covenant was placed (Joshua 18:1). The site served as the "capital" of Israel for over 300 years before Jerusalem.
In verses 60-67, we saw how God rejected the descendants of Joseph and did not choose the tribe of Ephraim (v. 67). But God was not completely giving up on His people. He was, in effect, removing the scepter from Joseph and passing it to Judah, as originally predicted by Jacob (cf. Gen. 49:8-12).
Isaiah 19:18-22 New International Version
In that day five cities in Egypt will speak the language of Canaan and swear allegiance to the Lord Almighty. One of them will be called the City of the Sun. In that day there will be an altar to the Lord in the heart of Egypt, and a monument to the Lord at its border. It will be a sign and witness to the Lord Almighty in the land of Egypt. When they cry out to the Lord because of their oppressors, he will send them a savior and defender, and he will rescue them. So the Lord will make himself known to the Egyptians, and in that day they will acknowledge the Lord. They will worship with sacrifices and grain offerings; they will make vows to the Lord and keep them. The Lord will strike Egypt with a plague; he will strike them and heal them. They will turn to the Lord, and he will respond to their pleas and heal them.