I don't see anything in there that would cause going out of sync. Though I notice your Y axis acceleration is very low.
Dual lead screws going out of sync is quite common though. When the motors power down they snap to the nearest full step, and not always in the same direction, so eventually they can go out of sync. This can be even more exacerbated if your bed is heavy and the lead screw lead is aggressive. You need to mitigate it in some way. Some people add a continuous loop belt between the two shafts to keep them locked together. Some switch to a single motor belted to the lead screws. Or you can use some sort of routine to adjust the motors independently and level the bed before every print. This requires moving one motor to it's own driver like E1.