Still not right.
The A from my schematic is the direction. If you just connect PWM where it should be VCC it will malfunction.
You should add 2 more NAND gates to make some sort of MUX, with the Outputs and "PWM".
Then, in your power section, probably the MOSFETs gates capacitances will interfere your output waveform, you should drive them with push-pull or totem-pole drivers.