Hi PaVelMag,
We'd like to help. As a start, check to see if Attention Aware Features are turned on. That could explain what you're seeing, depending on whether you're looking at your device when this happens or not. Turn Attention Aware features on or off on your iPhone or iPad Pro - Apple Support
"What are Attention Aware features?
Even if you don’t enroll in Face ID, the TrueDepth camera intelligently activates to support Attention Aware features. With Attention Aware features, iPhone can check whether you’re paying attention to your device and automatically take action. For example,
- When you’re looking at your device, your display will not dim until you stop looking at your device.
- If you're looking at your device, it will lower the volume sound of your alerts.
If you don’t want to use these features, open the Settings app, tap Face ID & Passcode, then turn off Attention Aware Features."
Take care.