@mazedasamarchhare In Harry Potter, they don't call it assembly. (They have alternative names for many things!) However, the whole school being in the same place for the address by Dumbledore at the start of the year, is very similar to assembly, especially with things such as the mail arriving at breakfast, Howlers and all. (See below.) In other books such as The Chalet School, assembly (or "Hall" as they call it) is very ritualised, with the pupils marching in and out to a teacher playing the piano.
I've asked this question on some other websites, and to some countries, school assemblies really are an alien concept, especially happening several times a week; some of the replies have been "shouldn't that time be used for education?". Some parts of America are wary of having the whole school gathered in one place, in case of terrible things happening.
As for pupils being humiliated during assembly: certainly it's exaggerated in fiction. Think of poor Ron Weasley receiving a Howler (a screaming letter) from his mother, in front of the whole school; and the first years being sorted into their houses, in front of the whole school. In the very British film Clockwise, there is an assembly scene where John Cleese is picking on individuals the whole time; and reportedly, foreign audiences find that assembly scene baffling. That film is not very well known - I think it should be better known.
Humiliation during assembly certainly has happened in real schools, although I expect it's rare now. I can remember loads of times this happened when I was at primary school in the 1980s (once or twice to me). Children were often singled out, and told off in front of the whole school, sometimes literally dragged or yanked from where they were sitting. Usually for low-level stuff like whispering, "hairdressing", or singing badly, and I remember times children were roundly berated for something which had happened earlier, in front of everybody. And back in the days of caning: this might not have actually happened in assembly, but pupils might be condemned to it in assembly. Roald Dahl describes how he had to hand in a "stripe" (a warrant to be caned) in front of everybody.