### Godot version

4.2.dev 5ee983188de97ae027f9b9c1443438063f708a7e

### System information

Windows 10 - Compatibility renderer 

### Issue description

When running a VR project sky contribution is not working in the compatibility renderer:

![image](https://github.com/godotengine/godot/assets/1945449/7aa19569-95c8-41a2-913b-37b81f4728a7)

It is working fine in normal mode. Can be worked around by setting sky contribution to 0 and providing an ambient color.

### Steps to reproduce

Try any project with a proper sky setup in XR, just switch to compatibility renderer.

### Minimal reproduction project

I'll try and create an MVP soon that can be used without XR hardware, but for now this can be used:
https://github.com/BastiaanOlij/godot_openxr_demo
atlas_rect.position.x = (quadrant & 1) * quadrant_size;
					atlas_rect.position.y = (quadrant >> 1) * quadrant_size;
					atlas_rect.position.x += (shadow_idx % subdivision) * shadow_size;
					atlas_rect.position.y += (shadow_idx / subdivision) * shadow_size;
					atlas_uv_rect.position = Vector2(atlas_rect.position) / float(shadow_atlas_size);
					atlas_uv_rect.size = Vector2(size, size);
					GLuint shadow_tex = light_storage->shadow_atlas_get_quadrant_shadow_texture(p_shadow_atlas, quadrant, shadow_idx);
					
					if (is_omni) {
						glBindTexture(GL_TEXTURE_CUBE_MAP, shadow_tex);
						glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_COMPARE_MODE, GL_NONE);
						copy_effects->copy_cube_to_rect(atlas_uv_rect);
						glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_REF_TO_TEXTURE);
						glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_COMPARE_FUNC, GL_LESS);
					} else {
						glBindTexture(GL_TEXTURE_2D, shadow_tex);
						glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_NONE);
						copy_effects->copy_to_rect(atlas_uv_rect);
						glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_REF_TO_TEXTURE);
						glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, GL_LESS);
					}
				}
			}
			
			glBindFramebuffer(GL_FRAMEBUFFER, p_fbo);
			Size2i size = p_render_buffers->get_internal_size();
			glViewport(0, 0, size.width, size.height);
			glBindTexture(GL_TEXTURE_2D, shadow_atlas_texture);
			copy_effects->copy_to_rect(Rect2(Vector2(), Vector2(0.5, 0.5)));