You need to follow the guide in order for gateway-scoped scripts to be able to access network drives.
When you run the script in the playground (designer scope), the Designer process belongs to your user and the drives are accessed as your user.
When you run it in the gateway scope, the process is the Ignition Gateway, running as a service under the service account, and the permissions will be different.