In iTunes (either on Windows or MacOS), when trying to make a backup of your iOS device, you can encounter a number of issues. The most common one is the following:
The password you entered to protect your iPhone backup could not be set
How to solve this error message in the iTunes program?
If you are connected over Wi-Fi, I suggest you first try to connect via the genuine iPhone charging/data transfer USB cable.
In case you are already connected with cable, try to unplug and plug in again your device. Also, try to restart your computer with the device connected.
Another possible fix for this error is to try another USB port on your laptop or desktop computer on which you try to set a backup password.
If you are still unable to set a password to encrypt your iPhone in iTunes, it may well be that your iTunes is no longer up-to-date. To resolve an outdated iTunes program, you should head over to the ‘Apple Software Update’ utility. Open it and search for new updates; install the newest updates and restart.