It's a layer bug. I just replicated it.
Ashley
Taximan
You have a family instance on the wrong layer, so it can not be z sorted.
Also the use of for each is redundant. You could just have the actions on the blank event. Set variable to y, then z sort.