I'm not sure if this would work in your specific use case, but for my project that has a similar perspective, I found that instead of using FlxSort.byY, which sorts by the top of the hitbox, you can make a custom function to make it sort by the bottom of the hitbox.
I added this function:
private inline function sortByBottomOfY(order:Int, o1:FlxSprite, o2:FlxSprite):Int
{
return FlxSort.byValues(order, o1.y + o1.height, o2.y + o2.height);
}
Then everytime you sort, use
this.sort(sortByBottomOfY);
Sorry if this doesn't relate to your issue!