DC Pump control via PWM

First: congratulations for using the schematic view!

The second circuit is correct. The Mosfet functions with voltage differences so you need to connect to both sides to make a voltage.

However the power supply must have some other internal connection which is bad for the USB. Can you unplug your laptop and run on battery power while connected to this circuit?