Repository: godot
Issue: Failed to create Windows OS Window
Labels: bug,platform:windows,topic:porting,needs testing

### Godot version

Godot Engine v4.0.rc6.mono.official.0cd148313

### System information

Windows 11, Vulkan API 1.3.217 - Forward+ - Using Vulkan Device #0: AMD - AMD Radeon RX 5700

### Issue description

As I was editing the project, this prompt suddenly occurred. There was no prior prompt in the debugger, and I'm not sure how I caused it. I was working with the animation tree transition node as it occurred.

```
Failed to create Windows OS window.
  Failed to create sub window.
  scene/main/window.cpp:521 - Condition "window_id == DisplayServer::INVALID_WINDOW_ID" is true.
--- Debugging process stopped ---
  Failed to create Windows OS window.
  Failed to create sub window.
  scene/main/window.cpp:521 - Condition "window_id == DisplayServer::INVALID_WINDOW_ID" is true.
  platform/windows/display_server_windows.cpp:966 - Condition "!windows.has(p_window)" is true. Returning: -1
  platform/windows/display_server_windows.cpp:966 - Condition "!windows.has(p_window)" is true. Returning: -1
  platform/windows/display_server_windows.cpp:966 - Condition "!windows.has(p_window)" is true. Returning: -1
```

Now anytime I try to open a window in godot, such as the color picker or any drop down menu, it just posts the following
```

  Failed to create Windows OS window.
  Failed to create sub window.
  scene/main/window.cpp:521 - Condition "window_id == DisplayServer::INVALID_WINDOW_ID" is true.
  platform/windows/display_server_windows.cpp:966 - Condition "!windows.has(p_window)" is true. Returning: -1
  platform/windows/display_server_windows.cpp:966 - Condition "!windows.has(p_window)" is true. Returning: -1
```

There also is the windows "error" sound anytime I try to open a window. I can build the project and run it, but it does not resolve the issue.

Here's some code from the console.

```
ERROR: Failed to create Windows OS window.
   at: (platform/windows/display_server_windows.cpp:3890)
ERROR: Failed to create sub window.
   at: (platform/windows/display_server_windows.cpp:722)
ERROR: Condition "window_id == DisplayServer::INVALID_WINDOW_ID" is true.
   at: _make_window (scene/main/window.cpp:521)
ERROR: Condition "!windows.has(p_window)" is true. Returning: -1
   at: window_get_current_screen (platform/windows/display_server_windows.cpp:966)
ERROR: Failed to create Windows OS window.
   at: (platform/windows/display_server_windows.cpp:3890)
ERROR: Failed to create sub window.
   at: (platform/windows/display_server_windows.cpp:722)
ERROR: Condition "window_id == DisplayServer::INVALID_WINDOW_ID" is true.
   at: _make_window (scene/main/window.cpp:521)
ERROR: Condition "!windows.has(p_window)" is true. Returning: -1
   at: window_get_current_screen (platform/windows/display_server_windows.cpp:966)
ERROR: Failed to create Windows OS window.
   at: (platform/windows/display_server_windows.cpp:3890)
ERROR: Failed to create sub window.
   at: (platform/windows/display_server_windows.cpp:722)
ERROR: Condition "window_id == DisplayServer::INVALID_WINDOW_ID" is true.
   at: _make_window (scene/main/window.cpp:521)
ERROR: Failed to create Windows OS window.
   at: (platform/windows/display_server_windows.cpp:3890)
ERROR: Failed to create sub window.
   at: (platform/windows/display_server_windows.cpp:722)
ERROR: Condition "window_id == DisplayServer::INVALID_WINDOW_ID" is true.
   at: _make_window (scene/main/window.cpp:521)
```

Restarting the editor solved the issue.


### Steps to reproduce

Not sure, possibly related to editing in Animation tree while debugging the project.

### Minimal reproduction project

N/A