We did this and other similar things in my rescue course, but we knew what would be happening going into it and had already established a dive relationship with the instructor. We didn't know the exact details, but we knew things would be happening. The instructor was more than qualified to teach this way and had been a military diver and a public safety diver trainer, etc.
Plus there were only three students, one of which didn't complete the course for whatever reason - the worst he got was trying to find a mask in the deep end without having a mask on, and having to identify and fix a bunch of instructor induced errors on a buddy underwater (super basic stuff like missing mask, missing fin, disconnected inflator hose, etc). The tiny class size meant the instructor was able to keep track of everything and everyone better than if it'd been a big class. My buddy and I also kept an eye on each other through all of this, just to be safe.
OW we did the 'out of air' when the instructor turns off the tank and a 'take off your gear underwater and put it back on' bit but nothing really intense.