Actually there is a connection. Matthew has the bloodline of Joseph, and contains Jechonias who the prophets said that none of his descendants would sit on the throne of Judea.
Luke has the geneaology of Mary going back to an obscure son of David, Nathan.
I am amazed by the inability of many to actual read. Luke 3:23 is NOT about Mary!!! I have heard that nonsense out of the institutional church all my life and it is absolutely not the case. It is very simple read so here it is:
“23 Now Jesus himself was about thirty years old when he began his ministry. He was the son, so it was thought, of Joseph,
the son of Heli, 24 the son of Matthat,
the son of Levi, the son of Melki,
the son of Jannai, the son of Joseph,
25 the son of Mattathias, the son of Amos,
the son of Nahum, the son of Esli,
the son of Naggai, 26 the son of Maath,
the son of Mattathias, the son of Semein,
the son of Josek, the son of Joda,
27 the son of Joanan, the son of Rhesa, etc.!!
Jesus was not the Son of Joseph!! That is an error. The linage is NOT THE SAME at stated in Matthew 1 — so one of them is in error ( if not both) and Luke states the linage of JOSEPH!!! not Mary.. Did you know that Jesus is the “Son of God” and if you don’t accept that as true. you do not have eternal life. ?
And I believe it was Nathan and Zadok the Priest (first priest of Solomon’s Temple) what presided over the coronation of Solomon.