There was a very good chance that Mary was married again after Joseph. This wouldn't be a sin if Joseph died.
How do we arrive at this?
We know that James was Jesus's half-brother. Probably Jude also.
Gal 1:19; But I did not see any other of the apostles except James, the Lord's brother.
Jude 1:1; Jude, a bond-servant of Jesus Christ, and brother of James, To those who are the called, beloved in God the Father, and kept for Jesus Christ:
There was another James, one of the sons of Thunder, the sons of Zebedee. But this one was called "James the less". Usually meaning James the younger.
It was very uncommon for disciples to be older than their tutor/mentor in those days, but not completely unheard of. There was another Judas also ( Iscariot )
We know that Mary had sons named James and Jude.
Matt 13:55; "Is not this the carpenter's son? Is not His mother called Mary, and His brothers, James and Joseph and Simon and Judas?
Mark 6:3; "Is not this the carpenter, the son of Mary, and brother of James and Joses and Judas and Simon? Are not His sisters here with us?" And they took offense at Him.
But we also know that Joseph wasn't James and Jude's father.
Luke 6:16; Judas the son of James, and Judas Iscariot, who became a traitor.
Acts 1:13; When they had entered the city, they went up to the upper room where they were staying; that is, Peter and John and James and Andrew, Philip and Thomas, Bartholomew and Matthew, James the son of Alphaeus, and Simon the Zealot, and Judas the son of James.
So either Mary wasn't a virgin when she married Joseph ( as she had at least two sons not by Joseph )
..or, she was married after Joseph... possibly twice. One of Jesus's brothers was named Joses or Joseph, this one was likely Joseph's biological son, as son's were typically named after their fathers.
So then, if Mary is the "mother of God", how many gods was she the mother of? The other option is .. Mary got around while she was married to Joseph.
Mark 15:40; There were also some women looking on from a distance, among whom were Mary Magdalene, and Mary the mother of James the Less and Joses, and Salome.
Mark 16:1; When the Sabbath was over, Mary Magdalene, and Mary the mother of James, and Salome, bought spices, so that they might come and anoint Him.
Matt 10:3; Philip and Bartholomew; Thomas and Matthew the tax collector; James the son of Alphaeus, and Thaddaeus;
Mark 3:18; and Andrew, and Philip, and Bartholomew, and Matthew, and Thomas, and James the son of Alphaeus, and Thaddaeus, and Simon the Zealot;
Luke 6:15; and Matthew and Thomas; James the son of Alphaeus, and Simon who was called the Zealot;
Acts 1:13; When they had entered the city, they went up to the upper room where they were staying; that is, Peter and John and James and Andrew, Philip and Thomas, Bartholomew and Matthew, James the son of Alphaeus, and Simon the Zealot, and Judas the son of James.