OK. The reason why RK seems to have a hard time is becuase of the way violations are handled. Joints are passed the stepsize so that they can constrain the connected bodies velocities to reduce any error by the ERP parameter (if ERP is 1 then errors are reduced to zero in one timestep). So this works nicely for Euler, but in RK the joints are reevaluated multiple times during a timestep. So at halfway through the timestep the violaion is halfway to being removed completely, but then is reevauated, so the correcting force is halved (becuase the error is now half). RK4 then kinda averages the forces over the whole timestep, so you end up with a corrective force that does not correct the force completely in one timestep. I have dealt with this in JointConfigurable for linear dimentions by applying a constant jerk (differential of acceleration) during RK4 stepping, but I don’t think that that is the best way to solve the problem. So when you run RK_4 on example 1, more constraints are present than in the same simulation with Euler, becuase constraints are never corrected properly. I think generally its just bad to have constraints in error, and can cause all kinds of problems when trying to solve the equations, especially when the constraints are interdependant (which they are).
A partial fix to the system I have put in is to essetially pass a halved stepsize to joints during RK-4 stepping. It helps, but does not completely work becuase RK_4 is a little more complicated, and it can’t really be solved by scaling by a single amount. A proper fix is a little more involved.
The much better solution is to aviold excessive violations in the first place. i.e. apriori collision detection.