You need to sent the environment variables for the shell you are starting with run-script. this can be done by adding source /etc/bashrc ; before your command in the script value.
[Expert@sc:0]# mgmt_cli -r true -f json run-script script-name "test" script "source /etc/bashrc ; vsenv" targets.1 "sc"
Here is an example, ignore the fail as I am executing the command on a Security Management Server
[Expert@sc:0]# mgmt_cli -r true -f json run-script script-name "test" script "source /etc/bashrc ; vsenv" targets.1 "sc" | jq -r '.tasks[]."task-details"[].statusDescription'
---------------------------------------------
Time: [10:24:48] 15/12/2023
---------------------------------------------
"cpx-sc - test" failed (100%)
vsenv: This is only supported on a VSX machine.