That is very interesting, thank you so much for the insight.
/bin/ls was just for testing purposes, if I instead just use another non platform binary, the program works correctly, even when launched within xcode.
In the real code I will be execing within a child process, this was just an exploration.