I think I have found the reason the magnetic couplers uncouple all by themselves when the train is long. If you examine the place where the pin keeps the knuckle closed, you will see that it is slightly tapered. Under vibration and tension on the knuckle, this makes the pin walk along the knuckle until the knuckle opens. I could cause the pin to walk up this slope by putting tension on the knuckle and wiggling it. I took a small cutter and a Dremel tool and ground a notch in the knuckle in the area where the pin engages the knuckle. I made the notch parallel to the pin. After I made the notch, I could not wiggle the knuckle and make the pin move to the uncouple position. I am going to modify a number of cars to test this idea, but it will be a few weeks before I get to it.