Swerve module getting an offset when turning and when initializing code

Hello, my team recently decided to change the gear ratio of the swerve modules (We are using the flipped x module), and on the old gear ratio of the swerve i tested Mechanical’s advantage advanced swerve code with Advantage kit and it worked fine, but on the new robot, whenever i deploy the code, the modules just spin randomly before stopping, and whenever i move the joystick too much, the direction of the modules gets wrong, here is a video.

We are pretty sure that it doesnt have to do with the CanCoder as we tested it with the code generated of CTRE and it moves without any issues, here is our code.

Any help would be appreciated, thanks!

So from what I understand, your code worked before you changed your gear ratio (I’m assuming you mean the angle gear ratio), but after you changed the gear ratio, the code no longer works. Did you change the gear ratio on your code to the new ratio?

According to your code repo, your angle gear ratio is currently 13.3714. Is that correct?

Yes, i changed the angle gear ratio for the new code

I would make sure the CANcoders took the offset

Are you making sure you are offsetting them in the code or are you just offsetting them in Tuner?

I tried both, when i tried the offset on the code and deployed the code, the modules would just go crazy for a few seconds, then go on a random position, even if i just change the offset of only one CANcoder, the same thing happens if i try it with the Phoenix Tuner