Did a little research into whats going on here.
First, the error message _wb_ refered to is "open /dev/tty: No such device or address". This message comes from trying to write to /dev/tty (the terminal connected to the current process), in order to send some message.
gpsp.sh yields this error message at the end of its output, whether its run from pandafe or via pnd_run.sh, unless run from a terminal (again, via either pandafe or pnd_run.sh). When run from a terminal the actual error message is revealed as:
"KDSETMODE_KD_TEXT: invalid argument"
Interestingly, when pandafe is run from a terminal, launching gpsp.sh returns exit code 0, which explains why the problem looked intermittent to me (I sometimes, but not always, test from a terminal). When its not run a terminal and thus /dev/tty is not hooked up, the no such device error causes an non-zero exit code.
This is arguably a bug in pnd_run.sh -- non-zero exit code if the pnd (quite reasonably) writes to /dev/tty. Its certainly a bug in pandafe given the loudness of the error dialog message when its encountered. I'll do something further on my end to make sure /dev/tty is available to spawned processes. Edit: new build on repo deals with this launching pandafe with "screen -D -m bin/pandafe $@". This makes /dev/tty available to spawned apps (and allows messages sent there to be captured with stdout/stderr). Nice.