This user has found a way --> iOS update - prompt for old passcode - Apple Community

The reasons I can think of is...
- If you are restoring from a backup that was taken from another device that had another Apple ID/Passcode, then to protect your data you are required to give the passcode of the other device too. This could be one reason.
- If you have changed the Passcode of the current device after erasing it and are trying to restore it from a backup that was taken using another Apple ID then also it may need the passcode that you had earlier.
The best would be to reset the passcode of the current device --> reset passcode -> If you forgot the passcode for your iPhone, iPad, or iPod touch, or your ... This would not ask you for the old passcode.
That is the best I can think of.

Set up your iPhone or iPad : Press and hold the device's power button until you see the Apple logo. You'll then see "Hello" in many languages. Follow the onscreen ...
Use a new Apple ID. Do not use an existing Apple ID...
How to create a new Apple ID: Create your Apple ID using the App Store on your device ... Tap Create New Apple ID. If you don't see this option, make sure that you're signed out of iCloud.