When a disk throws errors, the disk gets the blame. Sometimes the link between drive and controller is the real culprit, and the drive keeps counters for exactly that link.
Print the SATA Phy Event Counters:
sudo smartctl -l sataphy /dev/sda
Each line has an ID, a size, a value and a description, for things like CRC errors in frames and retries or resets on the link. Mostly zeros is what you hope for. A few counts can come from normal events such as booting, so one small number is not a reason to panic.
The useful move is to compare. Note the values, run a large read or copy, and look again. Counters that climb during traffic point toward the cable, the backplane or the port. Swap the cable, move the drive to another port, and see whether the climbing stops.
The counters can be cleared with a reset variant, which makes that before and after comparison cleaner:
sudo smartctl -l sataphy,reset /dev/sda
It prints the old values and then zeroes them, so save the output if you want to keep the history. This only changes these link counters, never your data or the SMART attributes.
I’d only rely on this for SATA devices, and drives behind a USB bridge or some RAID controllers may not pass the log through. SAS disks keep comparable information under the same option name but in a different layout.
Further reading: smartctl man page