It is recommended to measure the resistance of the extension cable. If the cable resistance is too high, the voltage on DS18B20 will drop during temperature conversion. If this is the reason, please
1. Increase the strong pull-up voltage.
2. Replace the cable with a low impedance cable.

It is also possible to power the DS18B20 with an external power supply instead of parasitic power.