You can try using layer_get_depth with a layer name to check depths. Otherwise it's hard to tell what this could be.