You can try replacing the power or data cables connected to the HDD, but that did not work for me. I had a HHD that would randomly disappear and appear after reboot, but never gave me any errors. The label on the HHD shows it was manufactured 29 JAN 2010 and the warranty was good for only three years. Anyway, I transferred all the data to a new HHD dated 20 March 2018 and had no problems since.
If the HDD is your boot drive it might be corrupted files.