What I mean to say is - there's a very high chance that your device is broken.
I found guy reporting it as software issue: https://www.reddit.com/r/galaxys10/comments/bzv9oq/proximity...
though other says it's faulty design https://www.reddit.com/r/galaxys10/comments/d94ob7/proximity...
Samsung recommended to return the phone, some people had luck with changing Touch sensitivity settings and Accidental touch protection https://piunikaweb.com/2019/03/18/samsung-galaxy-s10-proximi...
possible to test it here to see whether it's hardware or software issue https://forum.xda-developers.com/t/the-proximity-sensor-is-n...
But considering not all people have this problem it's either software error, software setting or some batches had hardware issue or they fixed the design.
There's no way Samsung made a phone with no proximity sensor
.. well, then again, they did make the Note 7.. https://youtu.be/0IVk8PsSgEI
https://nasilemaktech.com/samsung-galaxy-s10-series-proximit...
are you using samsung phone app or 3rd party app? see my other comment with links how to resolve it