Did you try performing a clean install of macOS by erasing the drive when you reinstalled macOS? This option destroys all data on the drive so make sure you have good verified working backups first. If you perform a clean install, test it before migrating or restoring from a backup since migrating or restoring may just bring back the problem.
To check the health of the hard drive you can create a bootable Knoppix Linux USB drive using Etcher (Mac/Windows/Linux). Use Knoppix version 8.2 since I've had some display issues with version 8.6. Option Boot the Knoppix USB drive and select the orange icon labeled "EFI". Give Knoppix time to boot as it can seem like the computer is frozen on the Apple boot picker menu (it is some odd Apple issue).
Once Knoppix boots to the desktop, click on the "Start" menu in the lower left of the Taskbar and navigate to "System Tools --> GSmartControl". Within the GSmartControl app double-click on the icon for the internal hard drive which should open up the health report for the hard drive. Post the complete report here so I can examine it. There should also be an option to run the drive's internal self diagnostics.