### Godot version

4.1 and 4.0.3 debug build

### System information

OS: Manjaro Linux x86_64
Kernel: 6.1.38-1-MANJARO 
CPU: AMD Ryzen 5 5600X (12) @ 3.700GHz 
GPU: NVIDIA GeForce RTX 3070 Ti
X11 backend
OpenGL API 3.3.0 NVIDIA 535.54.03

### Issue description

Game crashes silently after switching to compatibility rendering method. 
It's a pure 2D game. Forward+ and mobile work fine.

logs in console:

[4.0.3 debug build](https://github.com/Calinou/godot-debug-builds):
```
================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.0.3.stable.custom_build (5222a99f5d38cd5346254cefed8f65315bca4fcb)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /usr/lib/libc.so.6(+0x39ab0) [0x7fe425c9dab0] (??:0)
[2] /usr/lib/libGLdispatch.so.0(+0x4d6c9) [0x7fe4176de6c9] (??:0)
-- END OF BACKTRACE --
================================================================

```

4.1 official:
```
================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.1.stable.official (970459615f6b2b4151742ec6d7ef8559f87fd5c5)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /usr/lib/libc.so.6(+0x39ab0) [0x7fc48dfd9ab0] (??:0)
[2] /usr/lib/libGLdispatch.so.0(+0x4d6c9) [0x7fc48462b6c9] (??:0)
-- END OF BACKTRACE --
================================================================

```


### Steps to reproduce

Switch to compatibility rendering method and run game in editor.

### Minimal reproduction project
[signal11.zip](https://github.com/godotengine/godot/files/12061947/signal11.zip)



FUNC2(environment_set_bg_color, RID, const Color &)
	FUNC3(environment_set_bg_energy, RID, float, float)
	FUNC2(environment_set_canvas_max_layer, RID, int)
	FUNC6(environment_set_ambient_light, RID, const Color &, EnvironmentAmbientSource, float, float, EnvironmentReflectionSource)
#if 0
	FUNC2(environment_set_camera_feed_id, RID, int)
#endif
	FUNC6(environment_set_ssr, RID, bool, int, float, float, float)
	FUNC1(environment_set_ssr_roughness_quality, EnvironmentSSRRoughnessQuality)
	FUNC10(environment_set_ssao, RID, bool, float, float, float, float, float, float, float, float)
	FUNC6(environment_set_ssao_quality, EnvironmentSSAOQuality, bool, float, int, float, float)
	FUNC6(environment_set_ssil, RID, bool, float, float, float, float)
	FUNC6(environment_set_ssil_quality, EnvironmentSSILQuality, bool, float, int, float, float)
	FUNC13(environment_set_glow, RID, bool, Vector<float>, float, float, float, float, EnvironmentGlowBlendMode, float, float, float, float, RID)
	FUNC1(environment_glow_set_use_bicubic_upscale, bool)
	FUNC4(environment_set_tonemap, RID, EnvironmentToneMapper, float, float)
	FUNC7(environment_set_adjustment, RID, bool, float, float, float, bool, RID)
	FUNC10(environment_set_fog, RID, bool, const Color &, float, float, float, float, float, float, float)
	FUNC14(environment_set_volumetric_fog, RID, bool, float, const Color &, const Color &, float, float, float, float, float, bool, float, float, float)
	FUNC2(environment_set_volumetric_fog_volume_size, int, int)
	FUNC1(environment_set_volumetric_fog_filter_active, bool)
	FUNC11(environment_set_sdfgi, RID, bool, int, float, EnvironmentSDFGIYScale, bool, float, bool, float, float, float)
	FUNC1(environment_set_sdfgi_ray_count, EnvironmentSDFGIRayCount)
	FUNC1(environment_set_sdfgi_frames_to_converge, EnvironmentSDFGIFramesToConverge)
	FUNC1(environment_set_sdfgi_frames_to_update_light, EnvironmentSDFGIFramesToUpdateLight)
	FUNC3R(Ref<Image>, environment_bake_panorama, RID, bool, const Size2i &)
	FUNC3(screen_space_roughness_limiter_set_active, bool, float, float)
	FUNC1(sub_surface_scattering_set_quality, SubSurfaceScatteringQuality)
	FUNC2(sub_surface_scattering_set_scale, float, float)
	FUNC1(positional_soft_shadow_filter_set_quality, ShadowQuality);