One part of this confusion that's Mac specific is the blocking of DYLD variables from one shell to another. The path must be inherited; otherwise, it wouldn't know where to find afni or suma to begin with. This information is for the System Integrity Protection (SIP) that the MacOS introduced in 2015:
"Spawning children processes of processes restricted by System Integrity Protection, such as by launching a helper process in a bundle with NSTask or calling the exec(2) command, resets the Mach special ports of that child process. Any dynamic linker (dyld) environment variables, such as DYLD_LIBRARY_PATH, are purged when launching protected processes."