### 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.
ERR_FAIL_COND(tex_from->is_proxy); 
	if (tex_to == tex_from) {
		return;
	}
	if (tex_to->canvas_texture) {
		memdelete(tex_to->canvas_texture);
		tex_to->canvas_texture = nullptr;
	}
	if (tex_to->tex_id) {
		GLES3::Utilities::get_singleton()->texture_free_data(tex_to->tex_id);
		tex_to->tex_id = 0;
	}
	Vector<RID> proxies_to_update = tex_to->proxies;
	Vector<RID> proxies_to_redirect = tex_from->proxies;
	*tex_to = *tex_from;
	tex_to->proxies = proxies_to_update; 
	if (tex_to->canvas_texture) {
		tex_to->canvas_texture->diffuse = p_texture; 
	}
	for (int i = 0; i < proxies_to_update.size(); i++) {
		texture_proxy_update(proxies_to_update[i], p_texture);
	}
	for (int i = 0; i < proxies_to_redirect.size(); i++) {
		texture_proxy_update(proxies_to_redirect[i], p_texture);
	}
	
	texture_owner.free(p_by_texture);
	texture_atlas_mark_dirty_on_texture(p_texture);
}
void TextureStorage::texture_set_size_override(RID p_texture, int p_width, int p_height) {