Error messages:
iTunes could not restore the iPhone because the iPhone disconnected.
iTunes could not back up the iPhone because the iPhone disconnected.
The error message is commonly caused by a connection issue. To troubleshoot your connection, try using a different USB cable, and connect it directly to your computer, rather than via a hub or other device (such as a keyboard). You should also try using different USB ports on your computer.
If the error message is not caused by a connection issue, try restarting your computer and rebooting your iPhone. You can also try resetting your iPhone’s network settings (Settings → General → Reset → Reset Network Settings - though be aware that this will delete your WiFi passwords) and turning on both Airplane mode and Low Power Mode.
Some users have also found that they can avoid this error message by backing up their iPhone without encrypting the backup.