Problem with calibration of “Water level sensor” when power is turned on

When the sensor is submerged in water at the time of powering on, it doesn’t provide accurate measurements. If I place the sensor outside of water during power-on and then immerse it in water, the measurements become accurate. I’ve tried adjusting a cup bras the code to introduce a delay during setup.