Does the Microsoft script have some dependency on environment variables, that might not be present when running a non-login shell?
You might try
Wait /bin/sh --login -c "/usr/sbin/python /tmp/MicrosoftDefenderATPOnboardingLinuxServer.py > /tmp/output.txt 2>&1"
That should run with a login shell (processes things like .login that may supply more environment variables), and redirects the output and error messages to /tmp/output.txt. reading the output file may give more clues if python or the script itself are presenting error messages.