Execute pgScript in pgAdmin 4 while skipping errors
On psql, it's the default, but you can (un)set it with \set ON_ERROR_STOP 0|1.

So I suggest trying \set ON_ERROR_STOP 0 at the beginning of the script.

From documentation:


  ON_ERROR_STOP
  
  By default, command processing continues after an error. When this variable is set to on, processing will instead stop immediately. In interactive mode, psql will return to the command prompt; otherwise, psql will exit, returning error code 3 to distinguish this case from fatal error conditions, which are reported using error code 1. In either case, any currently running scripts (the top-level script, if any, and any other scripts which it may have in invoked) will be terminated immediately. If the top-level command string contained multiple SQL commands, processing will stop with the current command.