Value disappears from variables after random amounts of time pass

I have an array of objects that all implement the same interface called ‘Lootable’. This array is a fixed [20] and has the default value ‘None’. The array is a variable on a blueprint called ‘Inventory’, and this inventory is a variable on my TopDownCharcter blueprint.

I add items to this inventory on runtime and show them visually in a temporary widget blueprint which gets updated when charges happen to inventory. This disappearance is something that happens outside my scripts however so my update-function is not being called.

I’ve made a simple function that prints a string when the disappearance happens. This function runs on the tick-event and spams a string after a value has been added but suddenly disappears:
Debug function

On Event BeginPlay I run a Setup-function that instantiates the inventory and this is the only place Inventory gets created. The time it takes for values to disappear is random but usually within a minute (sometimes instantly) which leads me to believe that the bug is correlated to some heartbeat-function that runs by default in the editor, but I’ve been unable to figure out a solution on my own.

The issue seems similar to the problem from this thread: https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/120218-private-variables-losing-values-resetting-to-defaults-during-runtime

I’ve found other threads with similar issues where it was suggested that deleting the /Project/Saved or the /Project/Saved/Config folder might fix the problem. This did not help in my case however so I decided to ask here

I’m still struggling with the same issue. I’ve come to suspect that it’s garbage collection that’s causing it which would make sense. I’m not quite sure how garbage collection works in UE4 though but I do keep a reference to the inventory-object which is where my lootable[] exists, so to my knowledge this should be enough for it to survive. From what I’ve been able to read about GC on the wiki as long as something is a UPROPERTY that is referenced elsewhere it should not be GCed. It is still disappearing though so any help would be greatly appreciated.

What I’ve tried that didn’t work:

Instead of creating the inventory in a setup-function I create it in the actual level and set my char’s inventory to that object (I thought it might have been getting wiped because it wasn’t a part of the root map)

Instead of using a secondary inventory-class I made the inventory just be an array-variable on my playercharacter (ugly and didn’t work either.)

I’ve made a test-string variable that gets set at the same time as my array-values and the string persists but the array-values are purged (or reset to default values at least) so something wonky is definitely going on.