### 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

12.0.5

### What operating system are you using?

Windows

### Operating System Version

Windows 10

### What arch are you using?

x64

### Last Known Working Electron version

_No response_

### Expected Behavior

According to the doc [`BrowserWindow.getAllWindows`](https://www.electronjs.org/docs/api/browser-window#browserwindowgetallwindows): Returns `BrowserWindow[]` - An array of all opened browser windows. I expect that behaviour always.

### Actual Behavior

In the [`window-all-closed`](https://www.electronjs.org/docs/api/app#event-window-all-closed) event handler the `BrowserWindow.getAllWindows` is not empty, it returns the closed window.

Note: when running inside Electron Fiddle, the `console.error` from the `window-all-closed` does not appear in the Fiddle's console when the app quits. It appears in the Fiddle's console when you Run the app again.

### Testcase Gist URL

https://gist.github.com/8b63d0581b49793ce8bdddfe0aecaed3
shell/browser/native_window.cc
options.Get(options::kUseContentSize, &use_content_size);
  
  extensions::SizeConstraints size_constraints(
      use_content_size ? GetContentSizeConstraints() : GetSizeConstraints());
  int min_height = 0, min_width = 0;
  if (options.Get(options::kMinHeight, &min_height) |
      options.Get(options::kMinWidth, &min_width)) {
    size_constraints.set_minimum_size(gfx::Size(min_width, min_height));
  }
  int max_height = INT_MAX, max_width = INT_MAX;
  if (options.Get(options::kMaxHeight, &max_height) |
      options.Get(options::kMaxWidth, &max_width)) {
    size_constraints.set_maximum_size(gfx::Size(max_width, max_height));
  }
  if (use_content_size) {
    SetContentSizeConstraints(size_constraints);
  } else {
    SetSizeConstraints(size_constraints);
  }
#if defined(OS_WIN) || defined(OS_LINUX)
  bool resizable;
  if (options.Get(options::kResizable, &resizable)) {
    SetResizable(resizable);
  }
  bool closable;
  if (options.Get(options::kClosable, &closable)) {
    SetClosable(closable);
  }
#endif
  bool movable;