Arduino only works when connected to USB

Use a meter and measure it, assumptions can be flawed.

Thanks, yeah I've measured with a multimeter. Is there something specific you're asking about?

Here are some measurements that I've taken:

Arduino connected to USB, no circuit:
5V: 5V
VIN: 0V
Pin: 2.09

Arduino connected to powered circuit:
5V: 5.29V
VIN: 5.27V
Pin: 0V

Turning the MKR Zero on and then connecting it to the circuit works like the first case. In that case, the MOSFET module works correctly