There's a difference between a confession and a child reporting rape though. And what's currently happening is children reporting being raped or sexually assaulted are being treated as giving a confession by some religions in order to claim an exemption from reporting. That's clearly all shades of wrong.
In the UK, there is no clergy/penitent privilege recognised as a right. People still go to confession. Judges are granted discretion on deciding whether or not such evidence should be called. Most churches with a trained clergy have procedures to warn people that there may be circumstances where a conversation may not be kept confidential if they work in jurisdictions where this can happen. Even JWs in some countries have been warned by letter from the platform that elders may be required to disclose some information to secular authorities.
Really, there should be no excuse for an adult in a position of authority not to report abuse of a child or a vulnerable adult (legally defined as needing assistance to safeguard themselves) to safeguarding authorities. It really shouldn't be difficult to find systems and procedures to do that.