The bible has about a half dozen difference times where Jesus tells people to confess their sins to other people instead of to “God alone”, by the way:
“Therefore, confess your sins to one another and pray for one another, that you may be healed. The prayer of a righteous person has great power as it is working”
James 5:16
“If you forgive the sins of any, their sins have been forgiven them; if you retain the sins of any, they have been retained.”
John 20:23
” ‘But that you may know that the Son of Man has authority on earth to forgive sins’he then said to the paralytic ‘Rise, pick up your bed and go home.’ And he rose and went home. When the crowds saw it, they were afraid, and they glorified God, who had given such authority to men”.
Matthew 9:6-8
“Anyone whom you forgive, I also forgive. Indeed, what I have forgiven, if I have forgiven anything, has been for your sake in the presence of Christ”
2 Corinthians 2:10
But Mary is not alive. She can’t hear your confession.