There's a JUCE bug (?) which can be seen in JuceDemo's OpenGL Demo - see screenshot:
Simply resize the window slightly and increase the size of the teapot - and it occasionally occludes the components above it (depending on its current rotation).
Not seen in the screenshot is that these components flicker (at least on OS X 10.11.3) and aren't constantly hidden. (can be seen if stopping the rotation in the right place)
Here's a suggested fix:
(to just disable depth_test when drawing the components layer)