To me it looks like the expectation is implicitly like align_corners=True but you don’t pass that to grid_sample.
At least I get an error of 0.75 with your code and 2.134e-5 when adding align_corners=True.
Best regards
Thomas