### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a feature request that matches the one I want to file, without success.

### Electron Version

13.1.2

### What operating system are you using?

macOS

### Operating System Version

macOS Big Sur 11.4

### What arch are you using?

x64

### Last Known Working Electron version

11.4.5

### Expected Behavior

  - create the main window with `show: false` option
  - create the child window with a loading spinner and show it immediately
  - after 10 sec hide the child window and show the main one

### Actual Behavior

The main window is shown along with the child window, disregarding the `show: false` flag. This behavior is seen only on macOS.

### Testcase Gist URL

https://gist.github.com/f2a3a5e8d9130223f18b8ddade390f20

### Additional Information

_No response_
shell/browser/api/electron_api_base_window.cc
.SetMethod("setHasShadow", &BaseWindow::SetHasShadow)
      .SetMethod("hasShadow", &BaseWindow::HasShadow)
      .SetMethod("setOpacity", &BaseWindow::SetOpacity)
      .SetMethod("getOpacity", &BaseWindow::GetOpacity)
      .SetMethod("setShape", &BaseWindow::SetShape)
      .SetMethod("setRepresentedFilename", &BaseWindow::SetRepresentedFilename)
      .SetMethod("getRepresentedFilename", &BaseWindow::GetRepresentedFilename)
      .SetMethod("setDocumentEdited", &BaseWindow::SetDocumentEdited)
      .SetMethod("isDocumentEdited", &BaseWindow::IsDocumentEdited)
      .SetMethod("setIgnoreMouseEvents", &BaseWindow::SetIgnoreMouseEvents)
      .SetMethod("setContentProtection", &BaseWindow::SetContentProtection)
      .SetMethod("setFocusable", &BaseWindow::SetFocusable)
      .SetMethod("isFocusable", &BaseWindow::IsFocusable)
      .SetMethod("setMenu", &BaseWindow::SetMenu)
      .SetMethod("removeMenu", &BaseWindow::RemoveMenu)
      .SetMethod("setParentWindow", &BaseWindow::SetParentWindow)
      .SetMethod("setBrowserView", &BaseWindow::SetBrowserView)
      .SetMethod("addBrowserView", &BaseWindow::AddBrowserView)
      .SetMethod("removeBrowserView", &BaseWindow::RemoveBrowserView)
      .SetMethod("setTopBrowserView", &BaseWindow::SetTopBrowserView)
      .SetMethod("getMediaSourceId", &BaseWindow::GetMediaSourceId)
      .SetMethod("getNativeWindowHandle", &BaseWindow::GetNativeWindowHandle)
      .SetMethod("setProgressBar", &BaseWindow::SetProgressBar)
      .SetMethod("setOverlayIcon", &BaseWindow::SetOverlayIcon)
      .SetMethod("setVisibleOnAllWorkspaces",
                 &BaseWindow::SetVisibleOnAllWorkspaces)
      .SetMethod("isVisibleOnAllWorkspaces",
                 &BaseWindow::IsVisibleOnAllWorkspaces)
#if defined(OS_MAC)
      .SetMethod("setAutoHideCursor", &BaseWindow::SetAutoHideCursor)