Ansible Role Command Returns Error

Problem:
I have been testing running some ansible roles from a foreman host. I have one role that uses the command module to set up a globus connect server endpoint. When I run the role directly with ansible it returns correctly but when I use foreman to run the role on the host I get an error output even though the command completes correctly.

  925:
TASK [globus_node_setup : Initiate globus entpoint node] ***********************
 926:
fatal: [sched-dtn03.dromedary.peaks]: FAILED! => {"changed": true, "cmd": ["globus-connect-server", "node", "setup", "--client-id", " ", "--secret", ""], "delta": "0:00:03.830480", "end": "2023-04-24 13:55:01.469978", "failed_when_result": "The conditional check '(\"invalid_client\" not in result.sterr) and (result.stderr != '')\n' failed. The error was: error while evaluating conditional ((\"invalid_client\" not in result.sterr) and (result.stderr != '')\n): 'dict object' has no attribute 'sterr'", "msg": "non-zero return code", "rc": 1, "start": "2023-04-24 13:54:57.639498", "stderr": "invalid_client", "stderr_lines": ["invalid_client"], "stdout": "IP address not specified, using ", "stdout_lines": ["IP address not specified, using "]}

Expected outcome:

TASK [globus_node_setup : Initiate globus entpoint node] *********************************************************************************************
changed: [sched-dtn03.chpc.utah.edu]

Foreman and Proxy versions:
Foreman 3.7.0-develop
Foreman and Proxy plugin versions:
Ansible: 3.5.4
Remote-Execution: 9.1.0
Distribution and version:
Rocky Linux 8.7

The conditional check '(\"invalid_client\" not in result.sterr) and (result.stderr != '')\n' failed.

I guess result.sterr should be result.stderr, but have no clue why it would work when executed directly, but not via Ansible.

Whoops. That effectively solved the problem for me. Thanks!
I accidentally sent the output of one of the runs with my attempted fix but it looks like fixing that typo got my fix working. I was getting this error when running the role from foreman but it completed as changed when running directly. I added some changed_when and failed_when conditionals to handle the errors and that effectively fixed the issue for me.

TASK [globus_node_setup : Initiate globus entpoint node] ***********************

931:

fatal: [sched-dtn03.dromedary.peaks]: FAILED! => {"changed": true, "cmd": ["globus-connect-server", "node", "setup", "--client-id", " ", "--secret", ""], "delta": "0:00:02.959145", "end": "2023-04-17 12:14:10.656067", "msg": "non-zero return code", "rc": 1, "start": "2023-04-17 12:14:07.696922", "stderr": "invalid_client", "stderr_lines": ["invalid_client"], "stdout": "IP address not specified, using ", "stdout_lines": ["IP address not specified, using"]}