I'm teaching a class on using Raspberry Pis with ~50 students. We're having all of the students use headless VNC setups rather than connecting a keyboard/mouse/monitor, as setup is much faster for the students (using campus computer for other side of VNC connection). However a few are having a persistent issue where their VNC connection drops after a few minutes, and they are unable to reconnect to the Pi. Going non-headless reveals that the Pi is still functioning as normal (not frozen), is still connected to the campus WiFi network, and has the same IP address, but they cannot reconnect. Disconnecting and reconnecting to the campus network allows them to establish the VNC connection again.
We thought the cause could be the bottleneck created by all 50 VNC connections going through the same router, but it seems to always be the same Pis and they can't reconnect, so that doesn't seem to be it. I've also noticed that when we go non-headless on an affected Pi, it shows the campus computer as still being connected even though it's not. Forcing the computer to disconnect doesn't fix the problem, only reconnecting to the WiFi network.
Does anyone have an idea of why this is happening and how to fix it? Best workaround we've suggested for the affected students is to go non-headless, which is a bit more cumbersome for setup time. Any help is appreciated, thanks!