It also sometimes happens when you are standing right next to a wall, only in this case player acts as if there’s obstacle right overhead. It’s like if the tiles have absolute friction.
The code that is responsible for the movement of the character object is from Unity’s template platformer project, with a slight one line of code modification to discrete the resulting position for pixel snapping: