When locating a structure, the Y axis remains constant. That means when you click the coordinates given to issue a /tp command, you are sometimes teleported inside of blocks.
How to replicate
Generate a new world using the seed 'desert'
Type /locate Desert_Pyramid (it should give you one at 1872, ~, -160)
Click the coordinates
Observe that you have teleported inside of a block at level 63
It would make sense for the teleport to take your Y level into consideration and /tp you to the highest block at the coordinates (however my guess is that it can't do that because the chunk is yet to be rendered.)
Note to moderators: This bug may get closed as similar ones have been reported and closed before, but consider that while it may be considered "Expected behaviour" to teleport you and leave your Y level constant, surely it wasn't considered expected behaviour to teleport a player inside of a block. I think an earlier issue relating to Y=0 coordinates was "fixed" by preserving the player's Y level, but this has introduced new problems such as the above.
(If you try this with seed 6825116916374065574, and locate Desert_Pyramid, you'll get teleported into a block and fall directly into laval! Surely not intended.)
See also: MC-125002 which contains history of the Y=0 issue
Related issues
is duplicated by
Comments

Structures do not save a y coordinate, the ~ is just your current height, so you could say that it places you in the ground, in lava, in water, and in the air.
This is not really a bug.