A screenshot may certainly help, but I think I know what you mean.
Another thought I had what could be a solution for you, is when you have another aspect to sort sprites on. For example, to sort all “static objects” before or after “player sprites” when their Y positions are the same.