Export variable does not load properly

Godot Version

4.4.1 Windows

Question

I have this problem where one of the export variables of type SlotData (custom Resource) does not load properly.
As you can see in the screenshot below the other variables work as expected but the buy_price is somehow null.
The resource in the screenshot is created in the Inspector with new SlotData but I also tried it with a resource that I saved in my FileSystem.

I fixed it.
The SlotData class had an _init(data, quantity) function that had no default value for ItemData.
So apparently when using export variables Godot first creates the Resource with _init() and then sets the export variables instead of just creating the Resource with _init(export variables).
(It makes sense to do it like that, but I just wasn’t aware of it)
I fixed it by setting default values in the _init() function => _init(data = null, quantity = 1)

Summary: _init() has to work without arguments to be able to create a Resource in the Inspector’s export variables.