I would start by removing the G28, I know it is only supposed to home the X axis, but I dont think you the "X0". I beleive you only need the "G28 X".

Not sure why you want to re-home just the X Axis you could just do a G0 X0, that will move X to the 0 position without running the home routine.