1. Take the belts off of all 4 steppers and move the gantry around to see if you can feel differences.
2. Double and triple check that your machine is square and that the distances are the same for both X and Y frame rails. If not, the gantry is going to try and stretch or contract when it reaches either end of it’s travel.
3. Once you’ve done the above, move the gantry all the way to one side (X or Y) loosen one end that holds the rod, make sure it is sitting nicely in it’s cradle, then retighten. Then do the other axis the same way. It’s a good idea to make some physical stops to run the gantry up against. You can find some on thingiverse. Or use anything physical to run the two ends of the gantry up against (tie wrap something to the frame rails as an example).
4. Confirm, without belts that it is moving smoothly. (If not, you have something mechanical going on. Prints may be deformed and causing issues, etc.)
5. Also confirm that it stays almost perfectly square at rest.
6. Put the belts back on and test it out. Move the gantry all the way to one corner first to bottom out the X and Y using those physical stops you made. Then position it and run the job.
If it’s still having problems, time to look at the speeds things are running at, and you may want to change to series mode for your steppers (made a big difference for me).