A couple of issues...

The FET will only act as a diode until it is turned on. Once the FET is turned on, it will conduct in either direction, and you won’t be able to turn it off. So, as drawn, the FET is a resistor, and won’t do what you intended, which is for it to be a diode.

If instead you put a resistor in between the gate and ground, and a resistor from the USB input to the gate, then the FET would turn off when the USB cable was plugged in, which would do what you wanted.