You can see the coil spring on the uncoupler bar, just above the red oval in your picture.
The truck can be disassembled, that spring can then be stretched to increase its tension. That should solve the unwanted uncoupling.
You can also adjust the angle of the magnetic uncoupling tab, where it touches the uncoupling bar.
Or, you can just glue the coupler shut.