Not able to unlock Moto G7 Power even after "fastboot oem unlock"

I got the unlock code from motorola and run “fastboot oem unlock CODE”. The output after running it for the first time is:

                                               (bootloader) WARNING: This command erases all user data.

(bootloader) Please re-run this command to continue.
OKAY [ 0.001s]
Finished. Total time: 0.001s

After the second time is this:

                                               (bootloader) Check 'Allow OEM Unlock' in Android Settings > Developer 

(bootloader) Options
OKAY [ 0.001s]
Finished. Total time: 0.001s

Then, I run “fastboot reboot” but there is no sign that the phone is unlocked. When I go to developer settings, the OEM unlocking button is greyed out.
Any ideias?

The mobile was bought second hand after a factory reset.
Not sure if this could be affecting something.

I do not know the device but one possibility might be, if a private sale, that the previous owner had Factory reset the phone while leaving his Google account on the phone.

If this were the case (thus Factory reset protection is in place) it might be confirmed if you try to perform a Factory reset. If the factory reset asks for some permission, this is an indicator the last owners FRP is in place.

If you are right, what can be done?

ran into a greyed out settings oem-unlock slider before. I did a factory-reset twice and let it connect once to wifi, then the option was available again.

Problem solved!

It only needed to be factory reset once. Then, the stabdard procedurer worked smoothly.