MacBook Pro doesn’t recognize new internal HDD
The MBP 13" mid 2012 has some weirdness with the internal hard drive cable, which seems to be overly sensitive to many factors, including hard drive brand. I have seen trouble before with HGST drives and that model MBP.

Assuming you successfully tested the drive another way and found it working, I would try a new internal hard drive cable. Check the cable model number on its undeside, it's either 821-1480 or 821-2049. The former seem to be less reliable than the latter, so if you need to order a new one to test, I would order the latter.