you need first to sort slices by their Z coordinate, making sure that different slices which lie at the very same height gets placed in the very same tree branch
for instance, these two black ones, despite being separate geometries, they do share the same height so should be somehow receive the same preview color
here -to make things easier- I just grouped geometries together by their Z coordinate and flattened the data-tree so it could be dispatched (not that I notice, maybe you want the Pattern to have another “0” at the end, I corrected the uploaded file but not the screenshot) :