Wi-Fi Disconnects When Locking iPhone
I've found that ios devices tend to drop connection when they are locked if your 5Ghz and 2.4Ghz networks share same name.

Try changing one of your network's name.