You can do the same by pressing and holding the power button on the lock screen to pull up a menu, then press Lockdown. I'm not sure if it's enabled by default, but it is a security option on at least Android 11+.
At least 10+, and I think it may have been introduced in 9 if I remember past upgrades correctly. I don't think it's something enabled by default, but it is available to turn on in the default security settings page.
Kind of hard to do that in front of the coppers though, especially if they have already taken it from you.
Same on iOS and iPadOS. Power cycling requires the passcode.