I don't know, but I'd guess the wifi uses pin 26 for something. Try using a different one for your sensor. Or look up which pins the wifi does actually need.
Which ESP32 do you have?
Bits and pieces of info. Typically, analog pins are on portB which is are pins 32 and up.
There are 2 A:D converts on the ESP32. Typically the 2nd A:D converter is disabled during WiFi. The 2nd AD converter uses portA or pins less then 32.
Since the ADC2 module is also used by the Wi-Fi, only one of them could get the preemption when using together, which means the adc2_get_raw() may get blocked until Wi-Fi stops, and vice versa.
Now that you are using the ADC2 converter. Now the documentation has this to say bout WiFi and ADC2
Since the ADC2 module is also used by the Wi-Fi, only one of them could get the preemption when using together, which means the adc2_get_raw() may get blocked until Wi-Fi stops, and vice versa.
Here is a list of ADC2 pins
Notice how pin 26 falls within that range of being on ADC2?