Perhaps you are right. Of course, we would need the geneaology of Anna and Joachim to be sure he was not descended from David through Mary.
Exactly. That's why I said "as far as we know". But the Bible doesn't tell us any of that; it clearly makes it out to be that Jesus is of David's house because Joseph is.