The first thing you need to do in this case is to check the Wi-Fi sleep policy setting of the phone and make sure that the Wi-Fi stays on even when the screen is off.
- Swipe down from the top of the screen
- Tap and hold on the Wi-Fi icon
- Tap the Menu icon
- Tap Advanced Wi-Fi
- Tap Keep Wi-Fi on when screen is off
- Tap your desired sleep policy
If the issue persists, we need to look into other options. Please let me know if this information is helpful.