Switch between voltages
That is not what you want. By doing this you are connecting your 12v rail to 5v (minus the drop across the diode). This will cause a lot of current to flow through that MOSFET and cause it to overheat.

You want two MOSFETS, one on each voltage rail, and the teensy will only have one on at a time.