I’m creating a dialogue system but I can’t seem to figure out how to remove any unused previously deleted nodes that are saved to the Dialogue scriptable object asset from the default inspector. In the photo, if you press the - button in the custom inspector node

It properly deletes the sub assets which appear here.

However in unity’s built in inspector on the right if I push the - button, it does NOT delete the existing node in the bottom as this photo shows.
How would I go about changing how the existing inspector treats the - button. Or am I stuck with the inspector not cleanly deleting existing objects from the assets.
here is how I treat the - button on the nodes. This entire section of code is wrapped in an #if UNITY_EDITOR
to ensure only the editor can change dialogue nodes.
public void DeleteNode(DialogueNode nodeToDelete)
{
Undo.RecordObject(this, "Deleted Dialogue Node");
nodes.Remove(nodeToDelete);
string path = "Resources/Dialogue/" + _name + ".asset";
AssetDatabase.RemoveObjectFromAsset(nodeToDelete);
OnValidate();
CleanDanlgingChildren(nodeToDelete);
Undo.DestroyObjectImmediate(nodeToDelete);
}
