None of these scriptures condradict one another.
Matthew 27 refers to a woman called Mary, "the mother of James and Joseph".
Mary was a very common name in Bible times. Why do you have a problem believing that this woman had two sons who also had very common Bible names.
"To read it differently you will have to assume that Mary the mother of Jesus was a mother of James, Joseph, Simon, Jude, and an unnamed sister; and Mary Cleopas was a mother of James, Joseph, and Salome and a direct sister of Mary the mother of Jesus. In other words Jesus had a mother and an aunt called Mary, a brother and a cousin both called Joseph, and a brother and a cousing both called James."
You have finally figured it out. That is exactly what I believe because that is what the Bible teaches. Why does this give you such a problem? You did get some points wrong but they were minor. What took you so long to come to the truth?
Oh, I forgot. This would disprove the false doctrine of the perpetual virginity of Mary and for a Catholic, doctrine always trumps scripture.
The Bible does not teach that, if only because Matthew 13 and Mark 6 convey a question. To have two direct sisters of the same name is unheard of; to have identical by name sets of brothers and cousins is also unheard of. To refer to this confusing set of relatives by names only, never clarifying which Joseph and which James the evangelist has in mind, is not how the scripture is written.
The" false "doctrine of the perpetual virginity was held by both Luther and Calvin. Why is your reading of Scripture to be preferred over theirs?'