Duplicate Layer with Sublayers problem

I have a layer structure with sublayers I want to duplicate. As part of the command dialogue I am asked if I want the sublayers to also be duplicated and I check yes. I would expect the duplicate sublayers to also be grouped as sublayers under the new parent layer. If I make a simple example by opening a new file and dragging some layers into the default layer, and duplicate the default layer then this is exactly what happens-no problem. But on a more complex file I am working on now this is not what happens. Some of the layers are duplicated as sublayers and some are duplicated at the same level as the parent layer. I am not able to post the file but I have sent it to tech@mcneel.com