Connecting train cars with springconstraint causes very glitchy physics

I’m trying to make a cart ride and I want a locomotive and a generator cart, like in cart ride around nothing, but I want them to be connected by a spring, because I think it would be more fun. However, when I tried this, the carts started teleporting and acting very weird.

Here’s a video in which I try to drive the cart a bit on a long empty track, but the carts keep glitching out, as well as a few things I’ve fixed/checked (network owners, low friction):

I have no idea what causes the glitches. I tried giving the spring a strength limit, but it didn’t help.

definitely something to do with the mass of the carts

I’m not sure what you mean. I’ve tried way lighter carts and way heavier carts and they still have the exact same problem

What I recommend doing is:

Making a stability part. This can simply be done by having a part under the rail and in-between the rails, then weld these to the train.

Artists rendition (ik I’m a professional)

Red being the train, blue the rails, and green the safety part.

If you want sometimes for it to pop off, make it so the safety part is disabled or smaller.