You're hitting a modern issue of "attachment binding":
Caching Binding Lookup, and "Attachment Binding"
Today's attached variables aren't unset, they don't exist at all.
It's possible to not draw a distinction in the UI, and treat these as existing but unset... but I suspect that's not a good thing to do.
But really, attachment binding is kind of dodgy. Better ideas are welcome.