@handyandy you can configure it directly, rather than tricking Duet into thinking it is a fan.
See my thread here, where I did exactly this to control some linear pull solenoids, and an LED ring light for a vision camera.
This way you'll be able to control your light using
M42 Pn S1 ; turn on your light
M42 Pn S0 ; turn off
Where n is the number you assigned to your light, via the M codes in my thread linked above.
In my case, both the ring light and solenoid required 24V so I used OUT5 and OUT6, with the voltage select jumper set to VFUSED, as I too am supplying the board with 24V.
Alternatively you can configure the jumper to supply 12V on these pins, if you're within current limits.
Finally, I'd need to check the schematic to see if the outputs are just low side MOSFETS, in which case you likely can externally supply whatever voltage you need (within the drain-source breakdown limit of the FETs) and just use the ground side of the output pins, but take this last paragraph with a pinch of salt, as I've not done that check.