The seven sacraments · Question 4.3
“If I confess a crime, can I get out of being reported and punished?”

Penance and Reconciliation — a new start in forgiveness and reconciliation
The Church's answer: No. Absolution is not a license that erases the state's investigation, trial and duty of restitution. Real repentance has to stop the harm immediately and move toward turning yourself in, cooperating with the investigation, making restitution and accepting safety measures such as no-contact orders and treatment — all of that outside the sacrament. A confessor cannot disclose what he heard in confession, but a crime he learns of outside confession must be handled according to local law and safeguarding procedure.
If they press further: “If the priest can't report it, isn't confession sheltering a criminal?” — An investigation cannot proceed by breaking the seal of confession. But quite apart from the fact that a priest may not make reporting a condition of absolution, he must press hard for the crime to stop and for responsibility to be met, and steer the person toward getting help outside the sacrament. A community's safeguarding system also has to work independently, without relying on confession.
In one sentence: “The forgiveness of confession doesn't erase legal responsibility for a crime or the repair owed for the harm — real repentance moves toward safety and justice.”