To resolve the issue please follow the below mentioned steps:
>Perform Interactive checks through Samsung Members app (Samsung Member> Get Help> Interactive checks->Proximity Sensor).
>Reset the device settings by navigating to Settings >> General Management >> Reset >> Reset Settings.
>Check the issue in the safe mode.
For further assistance, register your concern in Samsung members app(Open Samsung members app>click on “+“icon>send feedback>Error report/ Ask Questions).
Regards,Team Samsung Members