Another option is to put a R-C filter in series with the fan so that the PWM gets smoothed out and you drive the fan with a variable voltage. Connect a resistor of between10 and about 200 ohms between the Duet fan output and the fan. Also connect a capacitor of at least 100uF in parallel with the motor.

I find it very hard to believe that the same motor works with RAMBO. The RAMBO board has a flyback diode in parallel with the fan output, but apart from that it has nothing else that would make a difference.

Standard Arduino PWM frequency is about 490Hz, but I don't know whether Marlin uses that or alters it.