XRunAndWait python script return same error code every time

Hello everyone!
I am glad that I can post my problem here and I am sure I will get help from such a lovely and growing community.
I am playing with XRunAndWait command and I set some sys.exit(X) cases, for X in [1,10] and the execution of script in UI Vision always return Exit code=2, no matter what. If I run my python script locally, it works perfectly fine, every time returning the desired result.

{
  "Command": "XRunAndWait",
  "Target": "C:\\Users\\Adrian Pop\\Desktop\\AEON\\hotmail_seeds\\venv\\Scripts\\python",
  "Value": "C:\\Users\\Adrian Pop\\Desktop\\AEON\\hotmail_seeds\\venv\\rand_prob.py",
  "Description": ""
},
{
  "Command": "echo",
  "Target": "${!xrun_exitcode}",
  "Value": "blue",
  "Description": ""
}

This is the JSON representation of the snippet.
Am I missing something?

Thank you so much!!