Error while entering Apple ID (entered someone else's ID) My wife received a used iPhone and decided to set it up herself. I thought that there would be no problems: what could go wrong there? but everything turned out to be much more serious
Briefly about the sequence of her actions:

The old Owner has left iCloud.
Setup for FaceId, and entering the confirmation password(twice).
Next, enter iCloud - and here the epic fail happened. The wife switches to the numeric keypad and enters the password (6 digits) from step 2 :).
Then he asks to enter the password for unlocking. The password that was set in step 2 is not suitable - it blocks when entered for 5/15 minutes. There is no way to go back to entering another AppleID.
As I understand it, at step two someone's real ID was entered (I just didn't know that you can enter it in the form of a 6-digit code) and now you need a password to unlock.
There is no password for this and there is no way to find it either.

can &quot;Recovery mode&quot; help me? if yes - is it not dangerous?
or do I need to use dfu?
What can be done in this situation?
Any advice - I will be very grateful.
p.s. a very scary decision if the user can make a mistake here - but there is no way to go back.
You seem quite panicked and distraught. Your question was very confusing and you may have misunderstood the situation, but from what I could have gathered I can provide these pieces of advice:

The old owner may have incorrectly removed the device from their iCloud account. This is a very easy mistake to make and has happened many times before. To correctly remove it, both you and the old owner need to carefully follow the instructions here (under &quot;If you no longer have your iPhone, iPad or iPod touch&quot;) otherwise the device may never be recoverable.
You may have misread the instructions and inputed the incorrect information into the incorrect fields. Press the back button on the screen until you return to the language selection screen and setup using the instructions here. Preferably, to reduce confusion, use quick setup, to auto-setup wi-fi and iCloud, if your wife (not you) have an iOS device, other iPhone, iPad, or iPod touch, running iOS 11 or later. You can find the version number by going to Settings &gt; General &gt; About &gt; Software Version.
You may have somehow broken the setup instance and the device needs to be reset. To do this follow the instructions here while making sure to choose update (if available, otherwise choose restore), when prompted. Note, this requires you to enter recovery mode, and should be perfectly safe provided the connection isn't interrupted (e.g. unplugging or turning off your computer) while the device is restoring. You shouldn't have to use DFU mode. Once you return to setup, follow the instructions above in part 2 to setup your device.

If after following these steps, you still can't setup the device, your best option is to go into an apple store and get them to correctly assess the issue your having and get them to fix it.