Yes what he has said is true,because it happens many times that we(being human) can't see any cavity from outside and then comes the role of technology and science and so X-ray shows everything and as u have mentioned that u haven't been able to sleep in recent times is because of the cavity that has extended upto the living part of the tooth called pulp or nerve which can be treated with RCT only.
Next Steps
Visit ur nearby dentist and get the RCT done.
Health Tips
Don't delay otherwise it may swell because of an abscess.