I found the solution. Even if it sounds so strange, it was due to a magisk module called Viper 4Android XhiFi. It took me 2 hours of research and a lot of nerves, but after the module was deactivated the sensor works again. I don't really need the module, but the sensor should work!