additionally, your problem could be that if you throttle your drive at the start of your motion, your wheels will slip a varying amount which will lead to inaccurate values in your motor encoders. using tracking wheels will eliminate this issue, the way tracking wheels work is that they are unpowered omni wheels, mounted on a lever that is rubber banded into the ground. An external encoder reads the value of these wheels. here’s a good topic about them:
this will give you a more reliable sensor value for how far your robot has travelled, instead of how far your wheels have spun.
if you don’t have room or don’t want to have tracking wheels, you can always lower your acceleration which will reduce but not eliminate wheel slipping.