Z Order and the touch handling system are separate. Z Order is only for the visual layout of your layers. The touch handling system, however, relies on the priority assigned when you register with the touch dispatcher. If you register two layers with the touch dispatcher who have the same priority, then the second layer will get the touches first, regardless of the Z ordering of the layers.
Here's the part that really confused me when I had the same issue. Whereas Z Order puts higher numbers on top of each other visually, it's exactly the opposite with touches. LOWER priority numbers actually get the touches first. To keep my own sanity, I refactored my code so that whenever possible I added layers in the same order as the Z index anyway, so the touches of the top layers would behave intuitively.
When this isn't possible, I use the touch priority system, and I define constants so that I don't get confused later. To register for touches using the priority system, use the following:
-(void) registerWithTouchDispatcher {
[[TouchDispatcher sharedDispatcher] addTargetedDelegate:self priority: DEFAULT_TOUCH_PRIORITY swallowsTouches:YES];
}