Attached photo shows me standing on Z: -51 but when targeting the block directly below me the "targeted block shows -52. (second photo shows vanilla cords as -49 and -50 respectively)
Edit: First I thought it might be an optifine bug, but I checked vanilla, and aside from the coords being completely different, the cords still do not line up.
There's no bug here. If your exact coordinate is something like -51.3, then the block coordinate becomes -52, because of how integer casting works with negatives.