Not saying you didn't do everything you could, I know what it's like, I had a little cutie that did this and it was an epic moment when I woke up hung over and she was crying to be let out so she didn't have to pee in the corner, and I clocked her right between the eyes and she shunned me for 3 days.
I stopped locking her in after that, and the problem went away.
If that's not possible, and you can't exclude her from the boy's bedroom effectively, then you need to send her away. I presume that you live in an apartment. I just moved into one, and I don't want to torture a cat by trying to contain it in here, it's basically impossible to contain cats without having problems.
I lost a pretty white and black cat in 2018 because he kept on sneaking outside my top floor apartment and most likely pissed off a negihbour by frequently breaking into their apartment through an open window, I never saw him again after one day.
Cats are not easy to keep if you don't live on ground level or live near a main road. Nothing worse than that moment you realise they have disappeared.