I had this same problem using either Emacs 26 from emacsforosx.com or Emacs 27 compiled using MacPorts. By happenstance I discovered this problem does not exist if I run Emacs from the Terminal (by running the executable). The problem does exist if I use "open" from the command line, if I run using Spotlight, or if I run it from the Finder.