'Don't cover the earphone area' problem

Everyday my Redmi Note 12 Android shows this problem after unlocking the phone. By pressing the volume up button I can activate the screen but after few times when a voice call comes the phone shows the notification and by pressing volume up button I can unlock the screen and can receive the call. After taking 3 to 4 calls receiving the screen doesn't wake up during next call and I can't receive the call. Then I need to restart the phone by a long press of unlock button. During call the screen sometimes awake even it is besides my ear. The sensor works but for an unknown reason it remains awake during call and its by my ear.

Redmi Note 12 is a good phone. The recent problem is making some problems to me.

How can I fix this problem?

crwdns2934089:0crwdne2934089:0 crwdns2934093:0crwdne2934093:0

crwdns2934109:0crwdne2934109:0

crwdns2889612:0crwdne2889612:0 0
crwdns2934285:0crwdne2934285:0