AddObjectToAsset (reference) becomes null

i have method that creates an asset (AssetDatabase.CreateAsset) from a ScriptableObject instance, and adds other ScriptableObjects to it’s list, then adds (AssetDatabase.AddToObject) these to the asset too. The problem i had was that exactly after i added them, i inspected the asset and all references had become null. I suspected an unintuitive feature of CreateAsset and delayed the AddToObject by an editorupdate after the CreateAsset and this time they didn’t become null refs. My question is:
Is this the ‘correct’ way to do it (Or do i have to expect it to break unexpectedly later on)?

(It seems the CreateAsset call doesn’t actually create the asset right away but queues it for creation somehow, even though this is not mentioned in the documentation, so i’m wondering)

Ok, i found the problem. It looks like i need to hit save (ctrl+s) or call AssetDatabase.SaveAssets (inconvient - saves everything) to persist the assets, as even taking focus from the unity window and re-fokussing it makes it lose the references otherwise… (i could understand, if it didn’t persist them through a restart, but only via refocussing is a bit too sensitive)