DRV8835 OCP false trip?
I found the answer to the strange behaviour.

The LEGO M motors were built using an unusually large (1uF) capacitor parallel to the windings to reduce noise.

This large capacitor causes to motors to have a large inrush current that exceeds the OCP limit AND duration.

This causes the DRV8835's OCP circuitry to engage, disabling the bridge trying to drive the motor. The OCP circuit retries after 1ms. The capacitor has plenty of time discharging through the motor.

I don't know why the OCP won't engage at higher PWM frequencies. It probably either has no time to engage, or the current won't even reach the OCP level in that short time, because of the stray inductances of cables and PCB traces.

The series resistor helps because it limits the inrush current together with stray inductances and losses of the cable and probably the filter capacitor itself.

A current limiting resistor is actually a very bad idea, because it can prevent the OCP to trip during a short, and burn out very quickly.

An inductor in series with the motor will be the final solution. It won't disable the OCP, but will limit the inrush current.

Reference: http://www.technicbricks.com/2012/11/lego-power-functions-incompatibilities.html