Hey there agri_pina,
Thanks for reaching out to the Apple Support Communities. So we understand the issue correctly, when the "Attention Aware Features" setting is enabled in Settings > Face ID & Passcode, your iPhone will not dim or turn off after walking away from your iPhone, is that correct?
If so, does turning off the "Attention Aware Features" setting resolve the issue?
If it does, and if you haven't already tried restarting your iPhone, give that a try with the steps shown here: Restart your iPhone - Apple Support
1. Press and hold either volume button and the side button until the power-off slider appears.
2. Drag the slider, then wait 30 seconds for your device to turn off. If your device is frozen or unresponsive, force restart your device.
3. To turn your device back on, press and hold the side button (on the right side of your iPhone) until you see the Apple logo.
While restarting can seem like a simple step, it can often help with resolving some unexpected issues like this.
If the issue persists after restarting your iPhone, how long is Auto-Lock set to in Setting > Display & Brightness > Auto-Lock?
Keep us updated on the results.
Take care!