The Gyroscope and Accelerometer sensors are defective. As a result, features that require these sensors do not work such as Auto-rotate, Compass, Flip to shh, Flip camera for selfie and games that require these functions.
The sensors work again after you restart the device but once you tap the back of the device, the issue reoccurs. Resetting the device does not fix the issue.
Below is the link to the adb shell dumpsys file:
Platforms Tools ADB Shell debug
The below images are from the Sensor Test app:
Sensor Test[Accelerometer test]
[Compass Test]
[Gyroscope Test]
I tried auto-rotating and it didn't work. I reset the device and it did not work. I booted in safe mode and it did not work.