### Godot version

4.0.3 stable

### System information

Windows 10 - Godot v4.0.3 - Vulkan (Forward+) - Nvidia GTX 1070Ti

### Issue description

The ORM material does not pick up the animated WorldEnvironment ambient lighting. It works in the viewport but not when running the game. 


https://github.com/godotengine/godot/assets/42893106/4cdff3d4-4418-4d66-ac6a-a911fc137d45



### Steps to reproduce

1. Create a 3D scene.
2. Create a mesh and apply a ORM material to it
3. Create a WorldEnvironment node
4. Create an AnimationPlayer
5. Animate the WorldEnvironment energy multiplier from 0 to 1
6. Play the animation in the viewport and then play the scene and see the difference.

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

GDCLASS(ShaderMaterial, Material);
	Ref<Shader> shader;
	mutable HashMap<StringName, StringName> remap_cache;
	mutable HashMap<StringName, Variant> param_cache;
protected:
	bool _set(const StringName &p_name, const Variant &p_value);
	bool _get(const StringName &p_name, Variant &r_ret) const;
	void _get_property_list(List<PropertyInfo> *p_list) const;
	bool _property_can_revert(const StringName &p_name) const;
	bool _property_get_revert(const StringName &p_name, Variant &r_property) const;
	static void _bind_methods();
	void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const override;
	virtual bool _can_do_next_pass() const override;
	virtual bool _can_use_render_priority() const override;
	void _shader_changed();
public:
	void set_shader(const Ref<Shader> &p_shader);
	Ref<Shader> get_shader() const;
	void set_shader_parameter(const StringName &p_param, const Variant &p_value);
	Variant get_shader_parameter(const StringName &p_param) const;
	virtual Shader::Mode get_shader_mode() const override;
	virtual RID get_shader_rid() const override;
	ShaderMaterial();
	~ShaderMaterial();
};
class StandardMaterial3D;
class BaseMaterial3D : public Material {
	GDCLASS(BaseMaterial3D, Material);
public:
	enum TextureParam {