I've got a Macbook Pro Late 2012 with a Samsung EVO 750 and 16 gb of ram. I've worked with it for a year with no issues. Two weeks ago, it suddendly got really really slow (APFS on High Sierra). I couldn't even open the Apple Logo menu in order to shut it down or maybe logoff. It took like 2/3 minutes or more to open a Finder window. After some reboots the Dock couldn't even load the App Icons, question marks everywhere. So I decided to create a bootable High Sierra USB drive, backup my data first (with Paragon APFS for Windows) and then reinstall the system on the disk. Here come the troubles. It looks like once I booted the USB drive, the Macbook saves a flag in its cache, so that the second time I reboot the laptop and open up the Startup Menu there are no USB disks despite the fact they're plugged in. After waiting like 24 hours the "cache flag" looks like disappearing, so the Laptop sees the usb thumb again. After some tries I succeded in installing MacOS Sierra, but after some reboots (OS working) it suddendly got slow again. I reformated the SSD on my desktop pc with windows 10 and tested its speed with Samsung Magician and CrystalMark. 500 mb/s read and write, I don't think the disk is the problem. I thought the internal sata cable could have been damaged, but then I succesfully installed Sierra on an HDD and it works like a charm on the laptop. No way to get the SSD working. I'm pretty stuck. Thanks to anyone who would help!
I'm pretty sure the last non-retina MacBooks shipped with a SATA II drive cable if it came with a SATA II HDD. (Which makes sense because it shipped with a SATA II HDD... Not sure if it was different if you chose the Apple branded OEM SSD option, or if that was even an option for your model.)
You say you have a late 2012 MBP, but it must be either a late 2011 or mid 2012, to have user upgradable drives and memory, but I think this Is the case for both iterations.
So basically what I'm guessing is happening is that your MacBook and SSD are trying to communicate with each other at SATA III speeds, but over a SATA II cable.
This cable is compatible with SATA III, and replacement should fix your problem. To check if this really is the issue, you can try to use the SSD over any other interface (with an external FW, USB, Thunderbolt enclosure, for example) and see if the same issues exist. If not, the cable's probably the culprit.