The only friction here is 'you're not allowed to do that' - which doesn't typically work on teenagers. We had the same rules for dumbbphones and iPod's 20 years ago and it didn't work then.
Fwiw when I was in school kids would definitely check their phones from time to time or send an occasional surreptitious text. But it wasn't as pervasive as it is today- I was pretty shocked to see even at the elementary school level how much class time kids spend on their personal devices
In many US schools, they'd take those things away (and return them at end of day, typically) 20-30 years ago. But it helps when it's policy, if it's not a policy then the teacher has no backing from the school.
It definitely reduced usesge though. I was the same age in teens with dumb phones and they were only banned in class. Either way, it's better to have the restrictions in this case than a free for all because teenagers will push limits constantly. I don't see a downside to this.