This is easily refuted because the genealogies are not lists.
In Matthew, Jacob WAS THE FATHER of Joseph.
In Luke, Heli WAS THE FATHER of Joseph.
This is directly stated in scripture.
There are a couple reasonable explanations for this.
This first is that the word father is being use in the ancestral sense, the same way that Abraham is called the Father of the Jewish people. Abraham isn’t literally the genetic father of every last Jewish person, though all members of the Jewish race are descended from him.
This is unlikely, as the Greek word used in Matthew is
ἐγέννησεν (gennaó). It is used
almost exclusively for the literal sense of “being the genetic father of”, though there are a few times it’s used in the metaphorical sense of “bringing one into a way of life”, or “to cause to arise.” Jesus uses the same word when describing the necessity of baptism and “being born” of the water.
This metaphorical understanding is bolstered a bit by the fact that there are several known gaps in he genealogical record, implying its use as a descriptor of lineage rather than genetic relationship. Still, it is clearly used at other points to describe a literal father-son relationship, so that explanation can’t be guaranteed.
Luke, on the the other hand, does not use any language of begetting. In the Greek there is no language of direct lineage used in any of the pairings. It simply says Jacob, of Heli.
The more likely explanation deals with how succession was handled in the OT times. There are a couple places in the OT where we see what’s known as a Levirate marriage. It is outlined explicitly in Deuteronomy 25:5-6.
If a married son dies without having children it is the duty of the dead man’s brother to then marry the widow and conceive a child. So, if Joseph’s mother married Heli, but Heli died without having a son, then Heli’s brother Jacob would have a duty to marry Heli’s widow and conceive a child. While genetically Joseph would be the son of Jacob,
legally he would be the son of Heli.
You really need to accept the fact that the modern standards for genealogy were not in play at the time this was written. It is necessary for you to understand, or at the very least acknowledge, the way family structure and the continuation of the family line was handled. This was the norm in Jesus’ time, and so it presents a perfectly reasonable explanation for the supposed discrepancy.
For a bit more in depth reading on this: