Skinning acts weird when joints are hidden

Please take a look at the following Youtube video:

//youtu.be/PPyTgYbLMKM

Basically, when the joints are visible in the scene, the mesh deforms correctly. When the joints aren’t visible by turning off the layer’s visibility or the joint’s visibility, part of the skin stays behind. Not showing joints in the viewport also works correctly.

Has anyone ever encountered something like this?

What viewport are you using? Viewport 2.0?