As long as the person in question has a firm purpose of amendment, is truly sorry for the sin and has a sincere desire and intent to go to Confession, the Lord will forgive their sin.
Remember…it’s not so much about the sacrament as it is about true penitence.
Anyone can go to Confession, be absolved in good faith by the priest, but if they do not have a firm purpose of amendment and in fact aren’t really sorry, then they aren’t absolved.
It is Jesus who forgives, and when we go to Confession, we are saying publicly to the priest, who is acting in the person of Christ. Jesus already knows what we have done.
Take, for example the parent who sees her child with chocolate frosting all over her face. Mom knows her little one has gotten into the frosting meant for the cake, and in her love, although she may be perturbed, she will forgive her darling. So she asks her child, “did you get into the frosting?”
She will not officially forive the child and bestow the grace of a hug and a warm washcloth to clean up the mess until the child confesses to her transgression and promises not to disobey this particular order again.
I know that this explanation is overly simplistic, but hopefully it adequuately explains at least some of this.
Jesus reads our hearts, and if we die without the opportunity for Confession, fully intending to go, then we will recieve the grace as though we had actually gone.
The grace of Jesus is infinite.
God bless you on your journey!