Transmission shifts hard after car warms up

Hey,
Recently the transmission completely failed in my 03 Pontiac grand am and I replaced it with one from the junk yard with approx 120,000kms on it. After replacing it it would shift hard and throw the code P0730 (incorrect gear ratio). Thinking the junkyard accedently sold me a bad transmission I asked them for a second one. After installing the second one with 100,000kms on it would do the same thing. After driving the car for about 10 min the SES light comes on, it stars shifting hard and it throws the P0730 code. I have cleared the code multiple times but it always comes back. I also don’t think it is an internal trans fault. Any ideas? PCM is up to date with the latest calibration as well.