That's the entire point. When your will is to do someone else's will that is called consent.
If ONLY Christ could keep the whole law PERFECTLY then Mary could not keep it perfectly so she had sin just like all men
The Catechism does teach that Mary was free from all sin:
508 From among the descendants of Eve, God chose the Virgin Mary to be the mother of his Son. "Full of grace", Mary is "the most excellent fruit of redemption" (SC 103): from the first instant of her conception, she was totally preserved from the stain of original sin and she remained pure from all personal sin throughout her life.Paragraph 2. "Concieved by the Power of the Holy Spirit and Born of the Virgin Mary"
On the other hand Mary was not a priest, and if she was as you say "sinless " then she had no "original sin" to "wash away"
I am simply bringing you an analogy. The Church does not teach believer's baptism and the Church does not teach that Mary was baptised in any rutualistic way. However, her consent of faith is fully analogous to believer's baptism as I understand what it means: a conscious decision for Christ.
But once on this topic, the purpose of baptism is not limited to remission of sin. It is also an entry into the family of Christ, His Church.
And you see no conflict in the fact your INFALLIBLE catechism says only Jesus could keep the law PERFECTLY and then in another part say Mary, like Jesus was sinless? No problem folks just keep moving along .......