Students a lot of the time do not enjoy class. So if they feel like it, they will just skip the class overall. Now that the hall pass is mandatory teachers will know if they have permission or not, whether they have a pass or not.
Sometimes class gets boring and you just feel like wandering around. Even though that doesn’t sound all that bad that is not the solution. That is not the solution because the safest place for you to be is supervised in the classroom, not wandering around in the hallways.
To kind of go along with that leaving class multiple times is also not the right thing to do. Getting out of class is one thing but trying to leave multiple times in one hour is a whole different thing. A solution to take a break is just stand up for a minute. Or you can ask your teacher to take a 5 minute break.
To conclude there are multiple things you can do or ask to do instead of going in the hallway. And it is important to stay in class and learn.