I had a similar issue a few months ago and fixed it by updating the firmware on the Brain and in the distance sensor. Click this link to get the latest firmware installer from VEX. If that’s not your problem, I am out of ideas.
My distance sensors would act funny until I discovered that I needed to block the sensors in my classroom that keep the lights on. It uses a similar system to detect motion to keep the lights on and interfered with the distance sensors.
I have had a large failure rate with distance sensors, I do not know if they cannot take the rough and tumble storage system or just go bad. Just purchased ten to restock from my original 30. I have found if you test them via the Device info on the Brain and it does not register then it is dead.
I have had some success at repairing these sensors. If the students stick their fingers in the eye sockets and push the metal screen down into the little reflectors they stop working. It is possible to get them working again by pulling the metal screen back out with a pin. The most success I have had is pulling the screen completely out, flattening it, then pushing it back down into the socket carefully. I also have had some where, in addition to pushing the screen in, the little reflector has been broken off, I will try to repair those with a drop of epoxy and will post the results.