How did this simple nmos level shifter break my STM32?
With 500k pullup your Miller coupling is going to be worse.  It is proportional to the gain of the inverting amplifier.  Even though you are running rail to rail, there is a gain during the transition.

If your input 12V toggled too quickly you could (maybe) couple enough voltage to exceed 3V.  

I have attached a simulation showing what I mean.  Here, the MOSFET is ideal (no parasitic source-drain capacitance modelled) so I added 10nF to mimic a real MOSFET.