### Godot version

4.0.beta.custom_build.a16b0fec4

### System information

Ubuntu 22.04 - Radeon RX 570, Gnome shell 42 X11

### Issue description

Cannot compile Godot with 
```
scons dev_build=yes CCFLAGS="-fpie" LINKFLAGS="-no-pie" module_navigation_enabled=no module_gdscript_enabled=no module_basis_universal_enabled=no module_bmp_enabled=no module_camera_enabled=no module_csg_enabled=no module_cvtt_enabled=no module_dds_enabled=no module_denoise_enabled=no module_enet_enabled=no module_etcpak_enabled=no brotli=no module_glslang_enabled=no module_gltf_enabled=no module_gridmap_enabled=no module_hdr_enabled=no module_jpg_enabled=no module_jsonrpc_enabled=no module_lightmapper_rd_enabled=no module_mbedtls_enabled=no module_meshoptimizer_enabled=no module_minimp3_enabled=no module_mobile_vr_enabled=no module_msdfgen_enabled=no module_multiplayer_enabled=no module_noise_enabled=no module_ogg_enabled=no module_openxr_enabled=no module_raycast_enabled=no module_regex_enabled=no module_squish_enabled=no module_svg_enabled=no graphite=no module_text_server_adv_enabled=no module_tga_enabled=no module_theora_enabled=no module_tinyexr_enabled=no module_upnp_enabled=no module_vhacd_enabled=no module_vorbis_enabled=no module_webp_enabled=no module_webrtc_enabled=no module_websocket_enabled=no module_webxr_enabled=no module_xatlas_unwrap_enabled=no target=editor -j2
```
command due error
```
In file included from ./core/templates/vector.h:39,
                 from ./core/io/compression.h:34,
                 from ./core/io/file_access.h:34,
                 from editor/project_converter_3_to_4.h:35,
                 from editor/project_converter_3_to_4.cpp:31:
editor/project_converter_3_to_4.cpp: In member function 'int ProjectConverter3To4::convert()':
editor/project_converter_3_to_4.cpp:4360:24: error: 'ERROR_CODE' was not declared in this scope
 4360 |         ERR_FAIL_V_MSG(ERROR_CODE, "Can't run converter for Godot 3.x projects, because RegEx module is disabled.");
      |                        ^~~~~~~~~~
./core/error/error_macros.h:633:24: note: in definition of macro 'ERR_FAIL_V_MSG'
  633 |                 return m_retval;                                                                                                 \
      |                        ^~~~~~~~
editor/project_converter_3_to_4.cpp: In member function 'int ProjectConverter3To4::validate_conversion()':
editor/project_converter_3_to_4.cpp:4364:24: error: 'ERROR_CODE' was not declared in this scope
 4364 |         ERR_FAIL_V_MSG(ERROR_CODE, "Can't validate conversion for Godot 3.x projects, because RegEx module is disabled.");
      |                        ^~~~~~~~~~
./core/error/error_macros.h:633:24: note: in definition of macro 'ERR_FAIL_V_MSG'
  633 |                 return m_retval;                                                                                                 \
      |                        ^~~~~~~~
scons: *** [editor/project_converter_3_to_4.linuxbsd.editor.dev.x86_64.o] Error 1
scons: building terminated because of errors.
```
Regression ~2-3 days old

### Steps to reproduce

Above

### Minimal reproduction project

N/A
String file_content_before = collect_string_from_vector(lines);
		uint64_t hash_before = file_content_before.hash();
		uint64_t file_size = file_content_before.size();
		print_line(vformat("Trying to convert\t%d/%d file - \"%s\" with size - %d KB", i + 1, collected_files.size(), file_name.trim_prefix("res://"), file_size / 1024));
		Vector<String> reason;
		bool is_ignored = false;
		uint64_t start_time = Time::get_singleton()->get_ticks_msec();
		if (file_name.ends_with(".shader")) {
			DirAccess::remove_file_or_error(file_name.trim_prefix("res://"));
			file_name = file_name.replace(".shader", ".gdshader");
		
		if (file_size < uint64_t(maximum_file_size)) {
			// ".tscn" must work exactly the same as ".gd" files because they may contain built-in Scripts.
			if (file_name.ends_with(".gd")) {
				rename_classes(lines, reg_container); // Using only specialized function.
				rename_common(enum_renames, reg_container.enum_regexes, lines);
				rename_cors(lines, reg_container); // Require to additional rename.
				rename_common(gdscript_function_renames, reg_container.gdscript_function_regexes, lines);
				rename_gdscript_functions(lines, reg_container, false); // Require to additional rename.
				rename_common(project_settings_renames, reg_container.project_settings_regexes, lines);
				rename_gdscript_keywords(lines, reg_container);
				rename_common(gdscript_properties_renames, reg_container.gdscript_properties_regexes, lines);
				rename_common(gdscript_signals_renames, reg_container.gdscript_signals_regexes, lines);
				rename_common(shaders_renames, reg_container.shaders_regexes, lines);
				rename_common(builtin_types_renames, reg_container.builtin_types_regexes, lines);
				custom_rename(lines, "\\.shader", ".gdshader");
			 else if (file_name.ends_with(".tscn")) {
				rename_classes(lines, reg_container); // Using only specialized function.
				rename_common(enum_renames, reg_container.enum_regexes, lines);
				rename_cors(lines, reg_container); // Require to do additional renames.