mount is adding a quarantine flag, causing: /bin/bash: bad interpreter: Operation not permitted - but not the usual suspects
The script was being run from inside a .dmg that had the quarantine flag set on it. When the .dmg was mounted, it was mounting it with a quarantine flag that is inherited, but doesn't show up. I unmounted the .dmg, removed the quarantine flag, and re-mounted it, and all was well.