Tip for anyone who encounter a similar problem - try checking the element.isConnected property. When removing an element from it's parent DOM node it also causes the parent element to be null.
element.isConnected
null