There is absolutely no excuse for this. It happened to me once in a 172. The Instructor distracted me and turned the fuel off. The engine stopped without any spluttering but the prop continued to windmill. I looked down and turned it back on again. What did I learn? Nothing. If an Instructor did this and the engine refused to restart, followed by an emergency landing resulting in injury or worse. Who would you blame? Don't listen to those who say that it makes better pilots rather than aeroplane 'drivers' because that it nonsense. Fly safe.