That’s Scripture.
The Hail Mary is not found as is in the Bible as a prayer to be prayed to her.
When you realize that prayer in and of itself is not worship but rather a request for assistance, and when you know that Miriam is the mother of God with us, not God herself, then you see that the Scripture in question is a very respectful and appropriate form of address to her.