Short answer
It is a way of naming, not a mistake. In Arabic, "brother of" or "sister of" can mean one of the same family line. Christians from Najran raised the question while the Prophet (ﷺ) was alive. He answered that people named their children after the prophets and righteous people who came before them. So "sister of Aaron" can mean she had a brother named after the prophet Aaron. It can also mean a woman of Aaron's line. Either way, it does not make her Moses' sister. The Bible speaks the same way. It calls Jesus the son of David, who lived a thousand years before him. It says Mary's own relative Elisabeth was of the daughters of Aaron. The Qur'an itself says many messengers came between Moses and Jesus, so it does not mix Mary up with Miriam. Islam's answer is that this is an ordinary way of naming.
Full explanation
What critics say
Moses and Aaron had a sister called Miriam, which is the same name as Mary in Hebrew. Critics say the Qur'an confused Mary, the mother of Jesus, with this Miriam, who lived more than a thousand years earlier.
“"O sister of Aaron! Thy father was not a man of evil, nor thy mother a woman unchaste!"”
“And Miriam the prophetess, the sister of Aaron, took a timbrel in her hand; and all the women went out after her with timbrels and with dances.”
Answered by the Prophet (ﷺ) himself
The Christians of Najran, a Christian town in Arabia, put the question to the Companion al-Mughira ibn Shu'ba. A Companion is someone who met the Prophet (ﷺ) and believed in him. He took the question to the Prophet (ﷺ). The Prophet (ﷺ) explained that people named their children after earlier prophets and righteous people. So the answer came in the Qur'an's own century, from the one who taught it.
Al-Mughira ibn Shu'ba says the Christians of Najran asked him how the Qur'an could call Mary "sister of Aaron" when Moses lived long before Jesus. He put the question to the Prophet (ﷺ), who answered that people used to name their children after the prophets and righteous people who had gone before them.
How the Qur'an uses "brother" and "sister"
The Qur'an calls the prophet Hud the brother of the people of 'Ad, meaning one of their own relatives. "Sister of Aaron" can work the same way. It can link Mary to Aaron as one of his line. Or it can liken her to him in devotion, as one who is "like Aaron". It does not make her Moses' sister. The Qur'an also says a succession of messengers followed Moses before Jesus came. So it knows the centuries between them.
“To the 'Ad people, (We sent) Hud, one of their (own) brethren: He said: O my people! worship Allah! ye have no other god but Him will ye not fear (Allah)?"”
“We gave Moses the Book and followed him up with a succession of messengers; We gave Jesus the son of Mary Clear (Signs) and strengthened him with the holy spirit. Is it that whenever there comes to you a messenger with what ye yourselves desire not, ye are puffed up with pride?- Some ye called impostors, and others ye slay!”
The Bible speaks the same way
Matthew opens by calling Jesus the son of David and the son of Abraham. Jesus calls a woman he heals a daughter of Abraham. Luke says Elisabeth, Mary's relative, was of the daughters of Aaron. No one takes these to mean that David, Abraham or Aaron was the actual parent.
“The book of the generation of Jesus Christ, the son of David, the son of Abraham.”
“And ought not this woman, being a daughter of Abraham, whom Satan hath bound, lo, these eighteen years, be loosed from this bond on the sabbath day?”
“There was in the days of Herod, the king of Judea, a certain priest named Zacharias, of the course of Abia: and his wife was of the daughters of Aaron, and her name was Elisabeth.”
“And, behold, thy cousin Elisabeth, she hath also conceived a son in her old age: and this is the sixth month with her, who was called barren.”
What critics say, and the answers
Qur'an 19:28 — Surat Maryam (Mary), verse 28
“"O sister of Aaron! Thy father was not a man of evil, nor thy mother a woman unchaste!"”
Cited for
"Sister of Aaron" shows the Qur'an thought Mary was the sister of Moses and Aaron.
The response
The Prophet (ﷺ) explained the phrase when this exact question was asked in his lifetime. The Bible calls Mary's relative one of the daughters of Aaron. It calls Jesus the son of David in the same way.
Where it lands — Either Mary had a brother named after Aaron, as the Prophet's (ﷺ) answer implies. Or the phrase names her descent from Aaron, as Luke's way of speaking does. Neither makes her Moses' sister.
Qur'an 66:12 — Surat al-Tahrim (The Prohibition), verse 12
“And Mary the daughter of 'Imran, who guarded her chastity; and We breathed into (her body) of Our spirit; and she testified to the truth of the words of her Lord and of His Revelations, and was one of the devout (servants).”
Cited for
Daughter of Imran and sister of Aaron together show the Qur'an made Mary into Miriam.
The response
The Prophet (ﷺ) said people named their children after the prophets and righteous people before them. Imran and Aaron are such names. The Bible repeats names in the same way. Matthew 1:16 makes Mary's husband Joseph the son of Jacob, just like the Joseph of Genesis. Elisabeth, of the daughters of Aaron, bears the name of Aaron's own wife Elisheba (Exodus 6:23).
Where it lands — Repeated family names are no more a mix-up in the Qur'an than in Matthew or Luke.
Perspectives
The critic's objection
The Qur'an mistook Mary, the mother of Jesus, for Miriam, the sister of Moses and Aaron.
The Bible names Miriam the prophetess as the sister of Aaron, and Qur'an 19:28 calls Mary "sister of Aaron".
Rebuttal
The Bible does call Miriam the sister of Aaron, and Mary shares her name. But the Prophet (ﷺ) answered this exact question in his lifetime: people named their children after earlier prophets. The Qur'an says many messengers came between Moses and Jesus, and Luke calls Elisabeth one of the daughters of Aaron.
It also calls her daughter of Imran, the Amram who fathered Moses, Aaron and Miriam.
Rebuttal
The Bible does name Amram as the father of Moses, Aaron and Miriam, but the Qur'an never says this Imran is that man. People named their children after earlier prophets and righteous people, as the Prophet (ﷺ) said. The Bible does the same: Elisabeth, of the daughters of Aaron, bears the name of Aaron's wife Elisheba.
Jewish: Miriam was Aaron's sister
In the Torah, Miriam is the sister of Aaron and Moses, children of Amram. Many Jewish readers say the Qur'an has confused Mary, the mother of Jesus, with Miriam.
Amram's children were Aaron, Moses and Miriam their sister, so "sister of Aaron" and "daughter of Imran" point to Miriam.
Rebuttal
The Prophet (ﷺ) answered this very objection: people named their children after the prophets and righteous people before them. The Bible itself calls Elisabeth, Mary's relative, one of the daughters of Aaron. And the Qur'an says a succession of messengers came between Moses and Jesus, so it does not place Mary in Moses' generation.
The Islamic perspective
"Sister of Aaron" can mean that Mary had a brother named after Aaron, or that she was a woman of his family line. It is not a mix-up with Miriam. The Prophet (ﷺ) gave this answer to the same objection in his own lifetime, and the Bible speaks the same way.
The Christians of Najran asked about this, and the Prophet (ﷺ) answered them. People, he said, named their children after the prophets and righteous people before them.
The Bible calls Elisabeth, Mary's relative, one of the daughters of Aaron.
The Bible calls Jesus the son of David and a healed woman a daughter of Abraham. It uses family words for descent.
The Qur'an uses "brother" for a relative, as when it calls Hud the brother of 'Ad.
The Qur'an says a succession of messengers came between Moses and Jesus. So it does not place Mary in Moses' generation.