### Godot version

4.1.1 stable

### System information

Windows 10

### Issue description

this is the default size loaded on startup 1024 which seems fine but it actually have loaded the default [2048] and ignored the size in project settings
![image](https://github.com/godotengine/godot/assets/53877170/c8c71de7-468a-487f-8e6c-dba1ce0f8fa5)

changing it now to any size will break it 
[2048]
![image](https://github.com/godotengine/godot/assets/53877170/3082ff09-b7d7-41f7-8fbb-813074a54135)

[512]
![image](https://github.com/godotengine/godot/assets/53877170/5ea4620f-52b5-4d0e-a5f5-747e777cd59d)


### Steps to reproduce

change 2d shadow atlas size in project settings while using compatibility renderer. 

### Minimal reproduction project

_
uint32_t current_batch_index = 0;
		uint32_t last_item_index = 0;
		InstanceData *instance_data_array = nullptr;
		LightUniform *light_uniforms = nullptr;
		GLuint shadow_texture = 0;
		GLuint shadow_depth_buffer = 0;
		GLuint shadow_fb = 0;
		int shadow_texture_size = 2048;
		bool using_directional_lights = false;
		RID current_tex;
		RS::CanvasItemTextureFilter current_filter_mode = RS::CANVAS_ITEM_TEXTURE_FILTER_MAX;
		RS::CanvasItemTextureRepeat current_repeat_mode = RS::CANVAS_ITEM_TEXTURE_REPEAT_MAX;
		bool transparent_render_target = false;
		double time = 0.0;
		RS::CanvasItemTextureFilter default_filter = RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT;
		RS::CanvasItemTextureRepeat default_repeat = RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT;
	} state;
	Item *items[MAX_RENDER_ITEMS];
	RID default_canvas_texture;
	RID default_canvas_group_material;
	RID default_canvas_group_shader;
	RID default_clip_children_material;
	RID default_clip_children_shader;
	typedef void Texture;
	void canvas_begin(RID p_to_render_target, bool p_to_backbuffer);
	
	void draw_lens_distortion_rect(const Rect2 &p_rect, float p_k1, float p_k2, const Vector2 &p_eye_center, float p_oversample);
	void reset_canvas();
	RID light_create() override;
	void light_set_texture(RID p_rid, RID p_texture) override;