If this SSD is in the Optical Drive bay, then perhaps the cable is not sufficient for working with an SSD. Apple never designed this miniature cable to be used with a high speed SSD. Or maybe SSDs just are not compatible with your optical bay SATA controller. This is not uncommon. You can try connecting the new SSD externally using a USB SATA Adapter, drive dock, or enclosure to see if the problem is with the optical drive bay or the SSD.
FYI, I notice you are using an MX300 SSD in the main drive bay. You should make sure that SSD is running the most current firmware since we've experienced a lot of problems with the older firmware on our organization's SSDs. The problem only occurs when the SSD tries to reallocate a bad block and is unable to do so resulting in data loss. I highly recommend you update the MX300's SSD firmware. You can use the downloaded firmware .iso file (must first extract the .iso from the .zip file) as a source for Etcher to create a bootable USB SSD firmware updater. Option Boot the USB drive and select the orange icon labeled "EFI".
https://www.crucial.com/support/ssd-support/mx300-support
To make sure your MX300 SSD doesn't currently have this issue run DriveDx and post the report here so I can examine it. If the SSD shows this issue, then the only way to fix it is by updating the SSD's firmware and using the SSD's built-in hardware secure erase feature to reset the SSD to factory defaults.
Upgrading the SSD's firmware should not cause data loss, but it is a serious update so there is always a possibility of data loss even if it is very unlikely. Make sure to have a good backup just to be safe.
FYI, you should always have frequent & regular backup especially when using an SSD since it is impossible to recover accidentally deleted data from an SSD plus an SSD can fail at any time without any warning signs. Make sure to backup both SSD and any external drives which contain important & unique data.