groupadd may not be in the $PATH
The $PATH for besclient (running in a non-login shell) may not be the same as under your interactive user account.
You may need to spawn a login shell to run it. Example at Trying to run a Python script for Linux - #4 by JasonWalker
You may need to specify the full path to groupadd