Did the teacher punish me correctly?

Did the teacher punish me correctly?
Photo is illustrative in nature. From open sources.

I am a schoolboy from Moscow, I have now graduated from 8th grade. But the story that happened to me last school year is not forgotten. I, then a seventh grader, was punished by a 4th grade teacher. Having nothing better to do, I ran into the classroom with the fourth graders during a lesson (we skipped our lesson). From the threshold he made a mess and shouted something. In general, I was a little naughty. And he ran into the corridor.

The teacher came out of the class, took me to her class and put me in a corner for bad behavior, as she said. In front of the fourth graders. After a while, she turned me to face the wall, disturbing her students, distracting me. She threatened that if I turn around, I’ll stand there for another break. He didn’t break discipline again and stood there until the end of the lesson. Half an hour, no less. I couldn’t do anything, I had to stand, and they punished me.

So I wanted to ask adults, among whom there may be teachers and psychologists, whether I was punished correctly? In general, could a primary school teacher put a high school student in a corner? Maybe the first time it was worth making a suggestion, talking to me strictly, reprimanding me, and letting me go? And then she immediately put it in the corner. I didn't expect it at all.
test-antibiotic.com

Of course, I saw that the teacher was very angry with me. And yet, is it necessary to punish? Yes, I felt awkward, ashamed, and blushed. In general, it had a strong effect on me. I'll never do that again. I really don’t want to stand in the corner. But the teacher “technically” put me there.