Why am I being promtped to enter a passcode for the wrong Apple ID during an iCloud restore?

Everything is fine until the last step. I've signed in using my apple ID. I get to the last step where I choose the last back up restore date, and it prompts me for a password to the wrong apple ID account. What now?
Well, your choices are limited. You can either try to recall the passcode and enter it to continue with the restore or set it up as new.

Original thread: https://forums.imore.com/threads/why-am-i-being-promtped-to-enter-a-passcode-for-the-wrong-apple-id-during-an-icloud-restore.309645/