How do I stop my phone from turning off the display whenever I put my finger over the phone speaker?
In this case, it was just a bug. All you need to do to fix this is to restart your iPhone and it should be fixed. Thanks to Apple support.