Note 11 doesn't have a hardware based proximity sensor. Instead, it uses software context and other data (like ultrasound and maybe the front camera) to detect proximity, something called "AI Virtual Proximity Sensor". It has been used in some Xiaomi devices since 2016-2017. In some devices, software (MIUI bugs) made the proximity sensor work
I think you shouldn't look for the firmware on which the sensor will work normally. Such a trifle as a sensor in a phone for 560 euros must work properly from the beginning in stock rom. There is no official support for xiaomi phones here, write about this issue on official mi.com. Or contact an authorized service center with this problem.
Once you have flashed Android 10, reboot your device into the OS and check if the sensors have started working again. A lot of Pixel users affected by this issue on the official XDA thread have confirmed that this method works. Several Xiaomi Mi A3 users have also successfully fixed the sensors on their devices by following the same method.
.