As the program argument[1] gets long, OP is experiencing various Undefined Behavior (UB).
int main(int argc, char *argv[]) {
char name[400];
strcpy(name,argv[1]);
printf("Hello %s!\n",name);
Once argv[1] has 400 characters or more, strcpy(name,argv[1]);
begins to copy data into various unowned portions of memory.
OP experienced seg fault with an input string length of 432, but since it is UB, it may change tomorrow, with different data, on another machine. OP did not explain how this data was set. I assume the argv[1] was set via OP's development environment.
OP ran in a shell and had different results "EXC_BAD_ACCESS". Since it is UB, anything can happen. This type of error is certainly an expected type of UB given the buffer overrun.
OP says: "The problem comes when I try to get it to execute actual shell code." I would assert the problem simple happens when the program executes strcpy(name, TooMuchData)
.