problem destroying scriptableobjects

Hi all!
I’m writing an editorwindow which serves as a tool to edit the data stored inside a gameobject in scene.
This gameobject has some fields that are references to classes marked as Serializable.
Moreover one of this classes stores a list of references to scriptableobjects.

class MyClass : MonoBehaviour
{
  public StorageClass storage;
}

[System.Serializable]
class StorageClass
{
  public List<MyScriptableObject> list;
}

[System.Serializable]
class MyScriptableObject : ScriptableObject
{
}

class MyDerivedScriptableObject : MyScriptableObject
{
}

I can add successfully scriptableobjects references to this list

MyClass obj;
MyDerivedScriptableObject o = (MyDerivedScriptableObject)Activator.Instantiate(typeof(MyDerivedScriptableObject),args);

obj.storage.list.Add(o);

I can save the scene and later load it and the added objects are still part of the Component structure.
But in the case where I have to erase some of these scriptable objects from the list something strange happens:

MyScriptableObject o = obj.storage.list[0]
obj.storage.list.Remove(o);
UnityEngine.Object.DestroyImmediate(o);

When this is executed the item is removed from list and object is destroyed but later on in the list suddenly appears a null element that when seen in the editor appears as a ‘missing object’ value.

It seems that Unity interprets that the component must still have a reference to an scriptableobject there instead of interpreting that I no longer want to hold that reference.

How can I overcome this?

Thanks a lot in advance

I found a solution: If I make the StorageClass inherit from ScriptableObject too then all works as expected. Hmmmmmm, strange…