### 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
RID render_target = p_render_buffers->render_target;
	GLES3::RenderTarget *rt = texture_storage->get_render_target(render_target);
	ERR_FAIL_NULL(rt);
	if (debug_draw == RS::VIEWPORT_DEBUG_DRAW_SHADOW_ATLAS) {
		if (p_shadow_atlas.is_valid()) {
			
			GLuint shadow_atlas_texture = light_storage->shadow_atlas_get_debug_texture(p_shadow_atlas);
			GLuint shadow_atlas_fb = light_storage->shadow_atlas_get_debug_fb(p_shadow_atlas);
			uint32_t shadow_atlas_size = light_storage->shadow_atlas_get_size(p_shadow_atlas);
			uint32_t quadrant_size = shadow_atlas_size >> 1;
			glBindFramebuffer(GL_FRAMEBUFFER, shadow_atlas_fb);
			glViewport(0, 0, shadow_atlas_size, shadow_atlas_size);
			glActiveTexture(GL_TEXTURE0);
			glDepthMask(GL_TRUE);
			glDepthFunc(GL_ALWAYS);
			glDisable(GL_CULL_FACE);
			scene_state.cull_mode = GLES3::SceneShaderData::CULL_DISABLED;
			
			for (int quadrant = 0; quadrant < 4; quadrant++) {
				uint32_t subdivision = light_storage->shadow_atlas_get_quadrant_subdivision(p_shadow_atlas, quadrant);
				if (subdivision == 0) {
					continue;
				}
				Rect2i atlas_rect;
				Rect2 atlas_uv_rect;
				uint32_t shadow_size = (quadrant_size / subdivision);
				float size = float(shadow_size) / float(shadow_atlas_size);
				uint32_t length = light_storage->shadow_atlas_get_quadrant_shadows_allocated(p_shadow_atlas, quadrant);
				for (uint32_t shadow_idx = 0; shadow_idx < length; shadow_idx++) {
					bool is_omni = light_storage->shadow_atlas_get_quadrant_shadow_is_omni(p_shadow_atlas, quadrant, shadow_idx);