Last time I saw this problem, replacing the PSU solved it. Likely because the HDD did not get enough power to work in that case, except from some power peaks.

You can also try replacing the IDE cables first, as this can also solve some HDD problems for non-SATA disks, because these old...