After setting Require password to power off, you need to verify the screen lock password when you press and hold the power button to shut down.
Setting method:
realme UI 7.0 & 6.0: Settings > Security and Privacy > More security and Privacy > Required password to Power Off
or Settings > Security & privacy > More security & privacy settings > Anti-theft features > Verify for power-off
realme UI 5.0: Settings > Security and Privacy > More security and Privacy > Required password to Power Off
realme UI 4.0: Settings > Password & security > System security > Require password to power off
realme UI 3.0 & 2.0 & 1.0: Not supported
realme UI R & Go & T & S & U Edition: Not supported
Note:
1. It can be verified by fingerprint and face.