Hi ashita32,
It sounds like there's encrypted data from the previous backup that needs the passcode to be restored. For help with restoring an iCloud backup and your passcode, test the steps below found in the article here: Restore your iPhone, iPad, or iPod touch from a backup - Apple Support
"Restore your device from an iCloud backup
- Turn on your device. You should see a Hello screen. If you already set up your device, you need to erase all of its content before you can use these steps to restore from your backup.
- Follow the onscreen setup steps until you reach the Apps & Data screen, then tap Restore from iCloud Backup.
3. Sign in to iCloud with your Apple ID.
4. Choose a backup. Look at the date and size of each and pick the most relevant. After you choose a backup, the transfer starts. If a message says that a newer version of software is required, follow the onscreen steps to update. If you don't see onscreen steps to help you update, learn what to do.
5. When asked, sign in with your Apple ID to restore your apps and purchases. If you've purchased iTunes or App Store content using multiple Apple IDs, you'll be asked to sign in to each. If you can't remember your password, you can tap Skip this Step and sign in later. You won't be able to use the apps until you sign in with your Apple ID.
6. Stay connected to Wi-Fi and wait for a progress bar to appear and complete. Depending on the size of the backup and the network speed, the progress bar might need a few minutes to an hour to complete. If you disconnect from Wi-Fi too soon, the progress will pause until you reconnect.
7. Now you can finish setup and enjoy your device. Content like your apps, photos, music, and other information will continue to restore in the background for the next several hours or days, depending on the amount of information there is. Try to connect often to Wi-Fi and power to let the process complete."
You can also find helpful information here: Restore all content to iPhone from a backup - Apple Support
If you continue to have an issue or get the prompt that the passcode is incorrect, reach out to Apple directly to further assist.
Get Support
Best.