There is clear Biblical evidence that Mary viewed herself as a sinner.
In connection with the birth of a baby boy, the Mosaic law commanded that, at the end of her purification period, a mother should offer a lamb one year old for a holocaust, and a young pigeon or turtledove as a sacrifice for sin.
Regarding a woman who could not afford to offer a lamb, the law stated: She is to take two turtledoves or two young pigeons, one for the holocaust and the other for the sacrifice for sin. (Lev. 12:6-8, Catholic Jerusalem Bible)
Had Mary been sinless, she would have misrepresented matters had she offered a sin offering. Yet the Bible reports that Joseph and Mary came to offer, in accordance with what is said in the Law of the Lord, a pair of turtledoves or two young pigeons. (Luke 2:24, JB)
By complying with a law applying to sinful humans, Mary acknowledged that she was imperfect.