That tutorial is pretty broken anyway. It uses stateAttached and stateDetached in bad ways. (Note: there pretty much are no good ways to use stateAttached and stateDetached except to debug something)
Nodes should be added in initialize() and removed in cleanup(). Alternately, there is a bit of dancing you can do with initialize()/cleanup() and setEnabled() to have it add/remove the nodes when enabled and disabled.
And as yang said, only attached objects are rendered. So if they are still being rendered then they are still attached. Either they weren’t detached or there were two sets of objects and they were attached twice and only one was removed. Some basic debugging will sort out what is happening.