Please note that it's not
MC-1635. (Looks different for me.)
I got this bug when I was playing on a realm server.
Whenever I ran into a anvil block on it's side, I walked "into" it a little bit and than got "ejected" out the block. My guessing is that the hitboxes of anvil blocks aren't broken in the client side while those in the server side are, making the players walk into the "illegal" part of the block and get teleported back to the last "legal" spot.
Watch the attached video for more info.