Possibly related: I've noticed that when I'm in humid weather and I stick my phone into a damp pocket, it basically monkey-tests until I pull it back out again. Flashlight might be on, string of gibberish might be queued up on a text message, etc. I'm normally really good about locking the screen when I'm done, but something with fingerprint or face recognition or lock screen quick actions behaves poorly.
I have the same thing, I tried to disable all functions of my Pixel 4 that would do that. It amazes me that the simplest thing is not done here: if proximity sensor senses your screen is covered - do not enable the screen ever. When I'm jogging my phone sometimes sends texts, runs apps etc, same when I have phone in my pocket. Why don't they use proximity sensor?
This works well, until the prox sensor stops working (e.g. a piece of dust lands on it) and you can no longer get the phone screen to turn on.
It cuts both ways. :(