In case it’s not clear, just deleting the added staff does not delete the notes. You have to empty the staff completely before removing it. (And even then, Dorico still remembers the staff.) This feature is useful for playback rendition of ornaments and other such situations.