DIAGNOSIS The bar is worn unevenly. One side rail is shorter than the other from friction.
FIX You need to dress the bar. File down the taller side rail with a flat file until both rails are even. Or, replace the bar.
IF THAT DIDN'T WORK The drive sprocket bearing could be worn, letting the sprocket tilt. Inspect for side-to-side play in the sprocket.
HEADS UP A worn bar destroys chains fast. Check bar wear monthly. Rotate the bar 180 degrees each time you sharpen to even out wear.