In this case, you can reset your network settings to fix the issue. Please try the steps below.
- Delete one of the accounts. Settings > Mail, Contacts, Calendars > iCloud, Exchange, .... account > Delete Account
- Reset Network Settings Settings > General > Reset > Reset Network Settings The phone will reboot.
- After the phone reboots Don't add any WiFi networks, until after you set up your account again Set up your iCloud, Exchange, .... account again Settings > Mail, Contacts, Calendars > Add Account Fill in all your settings After that, your account should sync up.
- Once you've verified that the account is working, then you can add your WiFi network back in, and it should keep working.