It should be noted that the entire Jewish race began with a miraculous birth of an old man and woman who was "past the age of childbearing". Additionally, women who were barren became mothers through the provision of God--not only Sarah, but Rebekah and Rachel as well.
Then Abraham fell on his face and laughed and said to himself, "Shall
a child be born to a man who is a hundred years old? Shall Sarah,
who is ninety years old, bear a child?" Genesis 17:17 ESV
And Isaac prayed to the LORD for his wife, because she was barren.
And the LORD granted his prayer, and Rebekah his wife conceived.
Genesis 25:21 ESV
When the LORD saw that Leah was hated, he opened her womb, but
Rachel was barren. Genesis 29:31 ESV
Additionally, Zechariah had apparently prayed specifically that God would allow he and his wife to have children.
But the angel said to him, "Do not be afraid, Zechariah, for your
prayer has been heard, and your wife Elizabeth will bear you a son,
and you shall call his name John. Luke 1:13
So, Zechariah's prayer, like Abraham's, Isaac's, Rachel's, Hannah's and others, was heard. The angel was merely announcing to Zechariah that his prayer would be answered. So, he actually doubted God's proclaimed provision and answer to his prayer.
Mary, however, had certainly not ever prayed that she would have a miraculous child out of wedlock, and a virgin had never given birth before, so her questioning is a quite a bit more understandable than that of Zechariah.