Yup.... It's why I prefer to correct unruly behavior in children with a "Go to your room" strategy. Only the "Room" would be a locked up bathroom. for how much time is needed. It wouldn't be their bedroom, where they'd have Internet access or a TV, electronics, games, etc. They can bring their homework or books to read, but that's all. And, of course, there would be water and a toilet if needed. Might even bring them their meals on a tray.
The objective being, teach them what it's like to live inside an adult Jail cell. Or, as close as I can get to one.