When using the "tp" command, you are being teleported to a Z coordinate that's bigger by 1 then the one you entered.
When using the "setblock" command, the block appears in a Z coordinate that's bigger by 2 then the one you entered.
*Description above happens when using coordinates without the numbers after the dot (example: using the Z coordinate 156 and not 156.51763...). When using a more exact coordinate, the "tp" command is teleporting you perfectly, and the "setblock" command spawns the block in a Z coordinate that's bigger by 1.
Duplicate of MC-30870 - If you have not, please use the search function in the future, to see if your bug has already been submitted. If you could not find the original report, please comment with the keywords you searched for.