MacOS Scripts & Remote Terminal - Logged in user, but...not?

So maybe I’m totally missing something here, but on MacOS clients, when I attempt to use the remote terminal session, or run a script in a toolbox, I’m operating as the logged in user, but environment variables aren’t mapped as they should be.

So for example, if I just SSH into a machine then I can ‘echo $HOME’ and it will list my home folder. But not in SimpleHelp’s terminal or scripts, it’s just not set.

Any way to remedy this?

EDIT: Okay, I’m partially wrong. ‘echo $HOME’ works in scripts, but not in the remote terminal. However, if I check on $PATH, it’s not grabbing the user’s full path on either one, only the base default path. So I think it’s not parsing the user’s .zprofile?

EDIT 2: Aaand, I’ve solved part of it. The user still had a .bash_profile rather than a .zprofile. The local terminal fell back to that fine, but the remote terminal didn’t. Renaming it to .zprofile fixed the remote terminal’s issue, but not the script at all. How is the environment for running scripts different from the remote terminal?