Godot Version
4.5.1.stable
Question
Issue description
When exporting a project (release mode), @export variables initialized with Resource.new() lose their references and become null at runtime, even though they work correctly in the editor and debug exports.
This only affects custom Resource subclasses used as default values for exported variables.
Expected behavior
Exported projects should preserve default resource instances created with Resource.new() in exported properties, behaving the same as in debug/editor mode.
Actual behavior
In release exports, the resource instances become null.
This breaks shared or nested resource setups, as subresources are missing at runtime.
Print inside the resource: <Resource#-9223371998233623138>
Print outside the resource:
Export target: Windows Desktop (.exe)
What am I doing wrong?