### 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
if (inst->lightmap_instance.is_valid()) {
						GLES3::LightmapInstance *li = GLES3::LightStorage::get_singleton()->get_lightmap_instance(inst->lightmap_instance);
						GLES3::Lightmap *lm = GLES3::LightStorage::get_singleton()->get_lightmap(li->lightmap);
						GLuint tex = GLES3::TextureStorage::get_singleton()->texture_get_texid(lm->light_texture);
						glActiveTexture(GL_TEXTURE0 + config->max_texture_image_units - 4);
						glBindTexture(GL_TEXTURE_2D_ARRAY, tex);
						material_storage->shaders.scene_shader.version_set_uniform(SceneShaderGLES3::LIGHTMAP_SLICE, inst->lightmap_slice_index, shader->version, instance_variant, spec_constants);
						Vector4 uv_scale(inst->lightmap_uv_scale.position.x, inst->lightmap_uv_scale.position.y, inst->lightmap_uv_scale.size.x, inst->lightmap_uv_scale.size.y);
						material_storage->shaders.scene_shader.version_set_uniform(SceneShaderGLES3::LIGHTMAP_UV_SCALE, uv_scale, shader->version, instance_variant, spec_constants);
						float exposure_normalization = 1.0;
						if (p_render_data->camera_attributes.is_valid()) {
							float enf = RSG::camera_attributes->camera_attributes_get_exposure_normalization_factor(p_render_data->camera_attributes);
							exposure_normalization = enf / lm->baked_exposure;
						}
						material_storage->shaders.scene_shader.version_set_uniform(SceneShaderGLES3::LIGHTMAP_EXPOSURE_NORMALIZATION, exposure_normalization, shader->version, instance_variant, spec_constants);
						if (lm->uses_spherical_harmonics) {
							Basis to_lm = li->transform.basis.inverse() * p_render_data->cam_transform.basis;
							to_lm = to_lm.inverse().transposed();
							GLfloat matrix[9] = {
								(GLfloat)to_lm.rows[0][0],
								(GLfloat)to_lm.rows[1][0],
								(GLfloat)to_lm.rows[2][0],
								(GLfloat)to_lm.rows[0][1],
								(GLfloat)to_lm.rows[1][1],
								(GLfloat)to_lm.rows[2][1],
								(GLfloat)to_lm.rows[0][2],
								(GLfloat)to_lm.rows[1][2],
								(GLfloat)to_lm.rows[2][2],
							};
							glUniformMatrix3fv(material_storage->shaders.scene_shader.version_get_uniform(SceneShaderGLES3::LIGHTMAP_NORMAL_XFORM, shader->version, instance_variant, spec_constants), 1, GL_FALSE, matrix);