### Godot version

4.1 beta 3

The same project works fine on 4.1 **beta 1 and beta 2.**

### System information

Tested on MacOS, Fedora and HTML5

### Issue description

I have a problem in version 4.1 beta 3 with a popup (popup panel). The first time it always displays correctly. Every subsequent time, I only see a black spot. 

[Nagranie ekranu z 2023-06-23 11-35-28.webm](https://github.com/godotengine/godot/assets/5132385/f7a7ad08-754c-4b4b-b594-b6880eff5f3d)

*The same if I show popup by methods like popup_centered.


### Steps to reproduce

I'm trying to reproduce it with a clean and minimal example, but unfortunately, without success. Maybe someone else has this issue or knows a way to reproduce it?

### Minimal reproduction project

I'm trying to create it.
pixel_data[i * 4 + 3] = 255;
		}
		glGenTextures(1, &texture_atlas.texture);
		glBindTexture(GL_TEXTURE_2D, texture_atlas.texture);
		glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 4, 4, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixel_data);
		GLES3::Utilities::get_singleton()->texture_allocated_data(texture_atlas.texture, 4 * 4 * 4, "Texture atlas (Default)");
	}
	glBindTexture(GL_TEXTURE_2D, 0);
	{
		sdf_shader.shader.initialize();
		sdf_shader.shader_version = sdf_shader.shader.version_create();
	}
#ifdef GLES_OVER_GL
	glEnable(GL_PROGRAM_POINT_SIZE);
#endif
}
TextureStorage::~TextureStorage() {
	singleton = nullptr;
	for (int i = 0; i < DEFAULT_GL_TEXTURE_MAX; i++) {
		texture_free(default_gl_textures[i]);
	}
	if (texture_atlas.texture != 0) {
		GLES3::Utilities::get_singleton()->texture_free_data(texture_atlas.texture);
	}
	texture_atlas.texture = 0;
	glDeleteFramebuffers(1, &texture_atlas.framebuffer);
	texture_atlas.framebuffer = 0;
	sdf_shader.shader.version_free(sdf_shader.shader_version);
}
bool TextureStorage::can_create_resources_async() const {