Oh, I missed the part where disconnecting it made a difference in the light, my bad.
Yeah, probably something in the tank then, since you replaced the complete switch. Maybe replace the tank if it is yellowed and old anyways? Or just leave the sensor unplugged and YOLO a little bit...