### 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)



FUNC3(canvas_item_add_rect, RID, const Rect2 &, const Color &)
	FUNC4(canvas_item_add_circle, RID, const Point2 &, float, const Color &)
	FUNC6(canvas_item_add_texture_rect, RID, const Rect2 &, RID, bool, const Color &, bool)
	FUNC7(canvas_item_add_texture_rect_region, RID, const Rect2 &, RID, const Rect2 &, const Color &, bool, bool)
	FUNC8(canvas_item_add_msdf_texture_rect_region, RID, const Rect2 &, RID, const Rect2 &, const Color &, int, float, float)
	FUNC5(canvas_item_add_lcd_texture_rect_region, RID, const Rect2 &, RID, const Rect2 &, const Color &)
	FUNC10(canvas_item_add_nine_patch, RID, const Rect2 &, const Rect2 &, RID, const Vector2 &, const Vector2 &, NinePatchAxisMode, NinePatchAxisMode, bool, const Color &)
	FUNC5(canvas_item_add_primitive, RID, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID)
	FUNC5(canvas_item_add_polygon, RID, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, RID)
	FUNC9(canvas_item_add_triangle_array, RID, const Vector<int> &, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, const Vector<int> &, const Vector<float> &, RID, int)
	FUNC5(canvas_item_add_mesh, RID, const RID &, const Transform2D &, const Color &, RID)
	FUNC3(canvas_item_add_multimesh, RID, RID, RID)
	FUNC3(canvas_item_add_particles, RID, RID, RID)
	FUNC2(canvas_item_add_set_transform, RID, const Transform2D &)
	FUNC2(canvas_item_add_clip_ignore, RID, bool)
	FUNC5(canvas_item_add_animation_slice, RID, double, double, double, double)
	FUNC2(canvas_item_set_sort_children_by_y, RID, bool)
	FUNC2(canvas_item_set_z_index, RID, int)
	FUNC2(canvas_item_set_z_as_relative_to_parent, RID, bool)
	FUNC3(canvas_item_set_copy_to_backbuffer, RID, bool, const Rect2 &)
	FUNC2(canvas_item_attach_skeleton, RID, RID)
	FUNC1(canvas_item_clear, RID)
	FUNC2(canvas_item_set_draw_index, RID, int)
	FUNC2(canvas_item_set_material, RID, RID)
	FUNC2(canvas_item_set_use_parent_material, RID, bool)
	FUNC5(canvas_item_set_visibility_notifier, RID, bool, const Rect2 &, const Callable &, const Callable &)
	FUNC6(canvas_item_set_canvas_group_mode, RID, CanvasGroupMode, float, bool, float, bool)
	FUNCRIDSPLIT(canvas_light)
	FUNC2(canvas_light_set_mode, RID, CanvasLightMode)
	FUNC2(canvas_light_attach_to_canvas, RID, RID)