it's called the boomerang effect. basically when you have bezier handles to position keyframe, you could run into situations where the motion should be static but the bezier handles create unwanted motion. more about it here:
if it's after the fact: select the two keyframes that you have the in between unwanted motion and select keyframe interpolation
choose linear for spatial interpolation:
here's my advice first thing I do when I teach after effects is go to preferences and tell my students to set the default to linear under preferences->general. I do this also in any system I am working on.
this can save so much trouble. if I want bezier I will create it myself thank you
You can close the Graph Editor, highlight the layer in question, and simply fix the Bezier Handles on the position path keyframes in the Comp window. That's how I do it.
this is possible but I find it user error prone. you have to contract 4 bezier handles that are on top of each other. it's too easy to mess it up.
4 position keyframes in PRECISELY the same place? A little extreme, if you ask me. I have no problems just zooming in, highlighting the problem keyframe and playing with the handles. Normally you just want to straighten out the motion path, anyway, and the handles take care of that nicely.
4 position keyframes in PRECISELY the same place?
potentially 4 bezier handles, not 4 keyframes. 2 keyframes - potentially 2 handles to each keyframe. you will have to contract all the handles to make the movement linear between these two same value keyframes. in my opinion this is a time consuming, complicated and less efficient way to work when all you want to do is set 2 keyframes as linear in space.
that's why I recommend right clicking and setting the keyframe interpolation in the menu. there is yet another efficient and fast way to do it: highlight both keyframes in the timeline, then use either the selection tool and Ctrl+Alt+Click on them in the composition window , or just use the pen tool and click- this will convert the bezier to linear in space.