You are thinking as a human thinks, and not as God thinks.
God saw that Jesus would die and that grace was given to Mary in advance — since he also saw that she would be the Mother of Jesus, true God and true man.
Please do read some of the Catholic apologetics, and try to understand it.
If God kept Mary from sinning before hand, then she never sinned and did not need a savior.
In which case, she lied when she called God her Savior. That blows the sinless thing.
It’s not too hard to figure out if you THINK it through.
And How do YOU know how God "thinks?