Hello Aseem,
Q: Can this be pointing towards a disk failure happening in future.
A: Maybe. You should be cautious, take regular backups, and run CHKDSK on the drive.
If you can repeat the experience you cite at will (no detection inside case, detection outside case), then I suggest the problem may not be the drive. I've seen EMF inteference cause problems like this. The routing of the IDE ribbon cables is different when the drive is inside the case vs. outside.
Suggestions:
1. Try re-routing the IDE ribbon cable inside the case. Keep it away from the power supply as much as possible.
2. Drives are so cheap it is not worth any serious amount of your time to "save" this one. If you don't get it to work for any reason, replace it. If you do, you'll reap a bonus. Today's drives have much higher recording densities than older drives like your 40 GB. This gives them a much higher data transfer rate on top of the 7200 RPM speed they all have now.
Did this help?
-----Steve Jackson
CEO/CSA
Software Corporation (Softcorp)
http://www.softcorp.us/probono
Advanced pro bono tools and utilities free for personal use