Apple has refused to provide the calibration tool for the sleep sensor to independent repair people. A German repairman has beaten Apple and developed a calibration tool.

https://rossmanngroup.com/sleeptool