If you read Gina Perry’s critique, her conclusions is that fewer than half of the participants thought it was real.
These were Yale students, so probably smarter than average, and the study didn’t do a very convincing job make it seem believable from what I’ve read.
When I took psychology in college I had to submit to random experiments to as part of my grade (there were alternatives but the experiments were easier). Before I’d ever heard of Milgram, if one of those studies had put me in a similar situation I would have smelled a rat immediately.
When I was in middle school the teachers created a fake “government decree” to convince us that there was a new sin tax on products kids use (as a simulation). I immediately knew it was fake as did many other students, but that didn’t stop us from playing along for fun. I talked to a few of my teachers later and they genuinely believed that we fell for it.
That's pretty fun that your teachers did that. I wish teachers attempted to immerse students in the things they're teaching about more often, rather than just reading about it in abstract through a textbook or whatever.