### Godot version

v4.2.dev.custom_build [8c1817f75]

### System information

Godot v4.2.dev (8c1817f75) - Windows 10.0.22621 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3090 Ti (NVIDIA; 31.0.15.3699) - AMD Ryzen 9 7950X 16-Core Processor (32 Threads)

### Issue description

NOTE: This is a separate issue from https://github.com/godotengine/godot/issues/54679, as this can be reproduced with much smaller values like 2K and 4K resolution lightmaps.

The issue originates from this particular error handling.

https://github.com/godotengine/godot/blob/8c1817f755b63a69378774d8d0f74499f663afe2/modules/lightmapper_rd/lightmapper_rd.cpp#L174-L179

When this is true, the following code fails to catch the error correctly and will crash afterwards due to the data being invalid (Notice how none of the code references this particular error case).

https://github.com/godotengine/godot/blob/8c1817f755b63a69378774d8d0f74499f663afe2/scene/3d/lightmap_gi.cpp#L1083-L1087

It seems it was intended at some point to consider the error but it doesn't seem to account for it.

I've opened an issue to discuss what solution would be preferable:

1. We handle the error correctly, propagate it as best as possible and indicate to the user the exact problem instead of crashing.

2. We handle the error silently and clamp the light-map size to the max dimensions allowed. A console warning could be an interesting solution here. This would personally be my preferred behavior as I wouldn't want to have to fix the scaling in every mesh I've re-imported just to test a low resolution bake, which can be fairly common to iterate on lighting before doing the final bake.

### Steps to reproduce

1. Set LightmapGI's Max Texture Size to a small value (e.g. 2048).
2. Attempt to bake the lightmap for a mesh with a big enough size and texel size so that a texture bigger than LightmapGI's Max Texture Size is required.

### Minimal reproduction project

N/A
config->set_value("remap", "type", "CompressedTexture2DArray");
		if (!config->has_section_key("params", "compress/mode")) {
			
			config->set_value("params", "compress/mode", 3);
		}
		config->set_value("params", "compress/channel_pack", 1);
		config->set_value("params", "mipmaps/generate", false);
		config->set_value("params", "slices/horizontal", 1);
		config->set_value("params", "slices/vertical", texture_slice_count);
		config->save(texture_path + ".import");
		Error err = texture_image->save_exr(texture_path, false);
		ERR_FAIL_COND_V(err, ret);
		ResourceLoader::import(texture_path);
		Ref<TextureLayered> t = ResourceLoader::load(texture_path); 
		ERR_FAIL_COND_V(t.is_null(), ret);
		ret[i] = t;
	}
	return ret;
}
RID LightmapGIData::get_rid() const {
	return lightmap;
}
void LightmapGIData::clear() {
	users.clear();
}
void LightmapGIData::set_light_texture(const Ref<TextureLayered> &p_light_texture) {
	light_texture = p_light_texture;
	RS::get_singleton()->lightmap_set_textures(lightmap, light_texture.is_valid() ? light_texture->get_rid() : RID(), uses_spherical_harmonics);
}
Ref<TextureLayered> LightmapGIData::get_light_texture() const {