Try connecting the laptop directly to your router using an Ethernet cable for a faster and more reliable connection as this will avoid any possible WiFi issues which are difficult to troubleshoot.
If you have access to another Mac then try creating a bootable macOS USB installer:
https://support.apple.com/en-us/HT201372
If you can boot into Internet Recovery Mode or from a USB installer, then you may need to click on "View" within Disk Utility and select "Show All Devices" before the physical drive appears in the left pane of Disk Utility.
https://support.apple.com/en-us/HT208496
If you don't see the physical drive using these instructions, then maybe you have a defective hard drive SATA cable. The hard drive SATA cable on the 13" mid-2012 model is known to have an extremely high rate of failure especially when using an SSD. OWC sells these cables.
If you have a Retina model laptop or a MBAir, then a third party PCIe SSD requires a system firmware update before you can use a third party PCIe SSD. This means that macOS 10.13+ must have been installed before removing the original Apple PCIe SSD so the laptop will work with the third party PCIe SSD. It also means you must be booting to a macOS 10.13+ installer since a third party PCIe SSD requires an NVMe driver only available in 10.13+.
Also some SSDs may not always be compatible with all computers. If you still have a problem, then provide the exact model of the laptop by entering the serial number here:
https://checkcoverage.apple.com/
And also provide the make & model of SSD.