isEnabled gives different result when set to false with Inspector's GUI vs through code

When setting isEnabled to false through GUI the object disappears and when setting it false through code scene.getNodeByName("__root__")._isEnabled = false its not disappearing but in GUI it becomes false.

You should not use mesh._isEnabled = false but call mesh.setEnabled(false) instead.