Could it be the other Mac is using a different LaTeX distribution? I set up that script to work with MacTeX (which is by and large a wrapper for TeX Live), so in theory it should work on any machine with that installed. Another possibility is that the other machine is older, and the texbin is in another location (they had to move it a while back to get around the changes Apple made to the UNIX subsystem).
If it is in a different location than /Library/TeX/texbin, then change the Environment setting in your Processing pane to match.
If you’ve used the minimal MacTeX installer (tug.org/mactex/morepackages.html), you do not get latexmk by default, and need to install it (so perhaps one machine used it and the other used the full installer?). You can easily install it with:
sudo tlmgr install latexmk
Or if you prefer a GUI, then TeX Live Utility.app (github.com/amaxwell/tlutility) is great, and can easily be installed if you use Homebrew:
brew cask install tex-live-utility
Both tools allow you to easily keep your TeX install up-to-date…