Sorry if this was already posted, couldn't find anything through search.
So, if you're one of those who have Error 4000 in iTunes when updating iOS you need to remove the passcode and keep device unlocked before the update starts. Weird, but it seems to help.
Solution taken from here: https://forums.macrumors.com/threads/trying-to-update-to-ipad-os-14-itunes-giving-error-4000.2255178/
UPD: Another potential fix is to set Auto-lock to Never in Settings > Display&brightness, and keep device unlocked before the update starts. Ping in comments if this really helps.