Question Why my internal hard drive disconnects automatically?

1) Check the cables, preferably replace them (assuming it's a desktop with SATA cable)

2) Check windows power settings if they are not turning off the hard drives after a while

3) This is unlikely to be your case but I had a similar problem when I had AHCI enabled. Disabling it fixed the problem and I've not noticed any performance decrease.
 
1) Check the cables, preferably replace them (assuming it's a desktop with SATA cable)

2) Check windows power settings if they are not turning off the hard drives after a while

3) This is unlikely to be your case but I had a similar problem when I had AHCI enabled. Disabling it fixed the problem and I've not noticed any performance decrease.

I've replaced the cables twice still no difference, in the windows power plan i changed the "Turn off hard disk after" to Never but I haven't noticed any changes.
About AHCI I don't want to disable it because my speeds are already slow.