### Godot version

Godot 4.0 beta 14

### System information

Debian 11, X11 Nvidia proprietary driver, GLES3 Compatibility

### Issue description

When creating a new scene and add a Sprite2D node, the node image becomes corrupted when selecting the root node.
The problem is gone after saving & re-opening the editor.

![Screenshot from 2023-01-24 12-19-24](https://user-images.githubusercontent.com/94308700/214218462-979ed804-6128-4fbb-87d3-286de9db9e7f.png)

Selecting the root node:
![Screenshot from 2023-01-24 12-19-35](https://user-images.githubusercontent.com/94308700/214218528-944083f4-f5fc-4088-a6c8-7702215ce1a0.png)

The resource preview is wrong too.
![Screenshot from 2023-01-24 12-19-48](https://user-images.githubusercontent.com/94308700/214218557-34177eba-98cc-46aa-86f3-9f613899137a.png)


### Steps to reproduce

Pretty straightforward.

### Minimal reproduction project

Any sprite will do, i think.
 rt->size.y > 40) {
		GLsizei width = rt->size.x;
		GLsizei height = rt->size.y;
		rt->mipmap_count = count;
		glGenTextures(1, &rt->backbuffer);
		glBindTexture(GL_TEXTURE_2D, rt->backbuffer);
		for (int l = 0; l < count; l++) {
			glTexImage2D(GL_TEXTURE_2D, l, rt->color_internal_format, width, height, 0, rt->color_format, rt->color_type, nullptr);
			width = MAX(1, (width / 2));
			height = MAX(1, (height / 2));
		}
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, count - 1);
		glGenFramebuffers(1, &rt->backbuffer_fbo);
		glBindFramebuffer(GL_FRAMEBUFFER, rt->backbuffer_fbo);
		glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, rt->backbuffer, 0);
		GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
		if (status != GL_FRAMEBUFFER_COMPLETE) {
			WARN_PRINT_ONCE("Cannot allocate mipmaps for canvas screen blur. Status: " + get_framebuffer_error(status));
			glBindFramebuffer(GL_FRAMEBUFFER, system_fbo);
			return;
		}
		
		for (int j = 0; j < count; j++) {
			glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, rt->backbuffer, j);
			glClearColor(1.0, 0.0, 1.0, 1.0);
			glClear(GL_COLOR_BUFFER_BIT);
		}
		glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, rt->backbuffer, 0);
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
	}
}
void TextureStorage::_clear_render_target(RenderTarget *rt) {
	
	if (rt->direct_to_screen) {
		return;
	}
	
	for (KeyValue<uint32_t, RenderTarget::RTOverridden::FBOCacheEntry> &E : rt->overridden.fbo_cache) {
		glDeleteTextures(E.value.allocated_textures.size(), E.value.allocated_textures.ptr());
		
		if (E.value.fbo != rt->fbo) {
			glDeleteFramebuffers(1, &E.