When the Sensor isn’t connected, you will get random ADC values.
I’ve used those capacitive sensors for soil moisture monitoring in the past.
I calibrated my Code with (2) const int values, one for Air, and one for Water (actual ADC readings for both media). Then map your future readings between these (2) const int’s.
The following were my actual calibrations for a 10-bit ADC, but this shows that without knowing the endpoints, the ADC readings from these sensors aren’t very useful:
const int AirValue = 593 ; // replace this value with Value_1
const int WaterValue = 278 ; // replace this value with Value_2
You might be way past this in your project, if so I apologize.