MOSFET Vgs doesn't go to zero when controlling it with open drain output
Your MOSFET is backwards.

Also, unless your micro is designed to handle 12V hanging on an open drain output the pin will be limited to whatever the output protects the pin with, usually a diode drop above Vcc.

I suggest you use two transistors.







simulate this circuit &ndash; Schematic created using CircuitLab