Before looking at what the Quran says about Mary the Mother of Jesus, and Miriam the sister of Moses, it will help to examine what the Bible has to say about the characters in question.
In the Old Testament, Amram is the father of Moses, Miriam, and Aaron (Exodus 6:20, 15:20). He is a minor character, whose life we know next to nothing about. He is only famous for being the father of Moses, Aaron, and Miriam, each of whom played a prominent role in the Exodus.
In the New Testament, Mary, the mother of Jesus, is descended from Judah (Luke 3:26, Hebrews 7:14). She has a cousin named Elizabeth (Luke 1:36). Elizabeth's husband is a priest named Zachariah. Their son is John the Baptist (Luke 1).
The following passage in Surah 19 of the Quran has the context of Mary, after having given birth to Jesus, returning from the desert with Him to her family:
Surah 19:27-28
27 Then she returned to her people, carrying him. They said ˹in shock˺, “O Mary! You have certainly done a horrible thing!
28 O sister of Aaron! Your father was not an indecent man, nor was your mother unchaste.”
Notice that Mary the mother of Jesus is called the "sister of Aaron". There is no evidence from either the Bible, or any of the tens of thousands of pages of early Christian writings before Muhammad - which discuss Mary the mother of Jesus thousands of times - that Mary the mother of Jesus either had a brother named "Aaron", or was ever called "sister of Aaron".
It is important to pause here, and establish a point. Oftentimes, Muslims, who are very ignorant of the Bible, and history, think that they can plausibly reconcile a new detail like this under the guise of an absence of historical evidence. That's why it's important to emphasize that there are tens of thousands of pages of the writings of early Christians, who lived before Muhammad. Not once is Mary called "sister of Aaron". Not once is a brother of hers named "Aaron" mentioned. Yet, she is mentioned thousands of times in these writings. That is because she was not called "sister of Aaron", nor did she have a brother named "Aaron".
However, as mentioned above, there is a very famous "Mary" in the Bible with a brother named "Aaron" - the sister of Moses, and daughter of Amram. In English, we call this Mary "Miriam", though in many languages, it is the same name. Arabic is one of the languages in which the names are identical (Maryam), and since Muhammad barely knew anything about the Bible, he conflated them.
This is established more clearly by looking at a passage in Surah 3:
Surah 3:33-39
33 Indeed, Allah chose Adam, Noah, the family of Abraham, and the family of ’Imrân above all people ˹of their time˺.
34 They are descendants of one another. And Allah is All-Hearing, All-Knowing.
35 ˹Remember˺ when the wife of ’Imrân said, “My Lord! I dedicate what is in my womb entirely to Your service, so accept it from me. You ˹alone˺ are truly the All-Hearing, All-Knowing.”
36 When she delivered, she said, “My Lord! I have given birth to a girl,”—and Allah fully knew what she had delivered—“and the male is not like the female. I have named her Mary, and I seek Your protection for her and her offspring from Satan, the accursed.”
37 So her Lord accepted her graciously and blessed her with a pleasant upbringing—entrusting her to the care of Zachariah. Whenever Zachariah visited her in the sanctuary, he found her supplied with provisions. He exclaimed, “O Mary! Where did this come from?” She replied, “It is from Allah. Surely Allah provides for whoever He wills without limit.”
38 Then and there Zachariah prayed to his Lord, saying, “My Lord! Grant me—by your grace—righteous offspring. You are certainly the Hearer of ˹all˺ prayers.”
39 So the angels called out to him while he stood praying in the sanctuary, “Allah gives you good news of ˹the birth of˺ John who will confirm the Word of Allah and will be a great leader, chaste, and a prophet among the righteous.”
Here, Mary the mother of Jesus is described as the daughter of Imran - the Arabic version of Amram - and she is given to Zachariah, the father of John the Baptist. While John the Baptist and Zachariah are certainly Biblical contemporaries of Mary, the Biblical and historical record know nothing about someone named "Imran" in relation to Mary the mother of Jesus. In fact, looking at Christ's genealogies indicates that her father was named "Heli", and some traditions call him "Joachim".
Instead, the famous "Mary" who was daughter of "Imram" in the Bible was Mary the sister of Aaron and Moses, who lived 1,500 years before Mary the mother of Jesus, Zachariah, and John the Baptist. Muhammad, indisputably, conflated the two Marys.
This mistake is repeated in Surah 66:
Surah 66:12
12 ˹There is˺ also ˹the example of˺ Mary, the daughter of 'Imrân, who guarded her chastity, so We breathed into her ˹womb˺ through Our angel ˹Gabriel˺. She testified to the words of her Lord and His Scriptures, and was one of the ˹sincerely˺ devout.
Mary is also called in the "daughter of Imran" in Sahih al-Bukhari 3411, 3432-34, 3769, 5418, Sahih Muslim 2431, 2527c, and Jami at-Tirmidhi 1834.
During his life, this conflation was brought to Muhammad by one of his companions, as we read:
Sahih Muslim 2135
Mughira b. Shu'ba reported:
When I came to Najran, they (the Christians of Najran) asked me: You read" O sister of Harun" (i. e. Hadrat Maryam) in the Qur'an, whereas Moses was born much before Jesus. When I came back to Allah's Messenger (ﷺ) I asked him about that, whereupon he said: The (people of the old age) used to give names (to their persons) after the names of Apostles and pious persons who had gone before them.
First, recognize that this is the canonical Muslim response to this error in the Quran. No one else can give any other explanation, because that would be arguing against what Muhammad says, and suggesting a different, or "better" solution than the one he gave.
So, what does Muhammad say? He says that, in essence, Mary the mother of Jesus, and her father, and her brother - who we have no Biblical record of even existing - all had the same names as the family of Moses, which was a common practice at the time.
Muhammad, then, and Muslims today, expect us to believe that, somehow, the fact that Mary the mother of Jesus was called "sister of Aaron", and had a father named "Imran", escaped the Biblical and historical record completely, until Muhammad wrote the Quran, in which there is already a different Aaron who is discussed prominently (Aaron is mentioned about 20 times), who also happened to have a sister named Miriam, who isn't actually mentioned anywhere in the Quran. But no, that isn't the Aaron spoken of in connection to Mary the mother of Jesus. Instead, the "Aaron" and "Imram" mentioned off the cuff in connection to Mary, as if they are famous, and we should know about them, are, in reality, two random, insignificant people who just happened to have the exact same names as the famous Biblical ones related to the other Mary (Miriam), and are mentioned nowhere in any history prior to Islam.
Muhammad got confused, and made a mistake that could only be made by someone who was vaguely familiar with the Bible could make - which fits his profile. He had, at best, an oral familiarity with a few of the major Bible stories from the Old Testament. He was not a prophet sent by God, but instead a usurper, trying to ride on the coattails of the great prophets of the Bible, which he knew next to nothing about - as demonstrated by this blunder.
Muhammad also committed a similar blunder with Saul and Gideon, as covered in this article.