This works:
$ mac-emacs -Q --batch --eval '(message "%S" (boundp '\''ns-version-string))'
t
But not the below. It looks like no accessible event loop so no sleep/wake in batch on macOS. This could be addressed by the current NS experts. It's not really clear why it was done this way. Running applescript scripts doesn't have to be tied to a GUI. Neither does sleep/wake.
$ mac-emacs -Q --batch --eval '(ns-do-applescript "display notification \"foo\"")'
+ exec /Applications/Emacs.app/Contents/MacOS/Emacs -Q --batch --eval '(ns-do-applescript "display notification \"foo\"")'
Error: error ("Window system is not in use or not initialized")
mapbacktrace(#f(compiled-function (evald func args flags) #<bytecode -0x1fffb8046512f81>))
debug-early-backtrace()
debug-early(error (error "Window system is not in use or not initialized"))
ns-do-applescript("display notification \"foo\"")
command-line-1(("--eval" "(ns-do-applescript \"display notification \\\"foo\\\"\")"))
command-line()
normal-top-level()
Window system is not in use or not initialized