Motion blur - layer appearing behind other layers

I have a man in front of a desk - he flies in from the left. When I add motion blur to the character, although he is at the top of the stack, he flies in from behind the desk and comes in front of it.

This only shows like this in the comp with the character and the desk, when I view the nested comp in the main comp, it looks fine. Until I render that is and then the character flies in as if the desk was at the top of the stack.

Stacking order doesn't generally matter when working with 3D layers, instead the position of the layers determines which is in front. Motion blur complicates this a bit more as there are now several sub-frame samples being taken to render the layer, some of the samples may appear in front and some behind. Your Shutter Phase may affect this.

The easiest way to solve this problem is to separate your two layers more using the position. If one layer has no keyframes, that'd be my first choice for moving :)