AFAIK Bubble does not let you sort by related record (unless this has been a recent addition). It seems like what is needed here is sort by thing’s things’s property.
I’ve run into this before and the workaround can be a little ugly - I created backend workflows that denormalized the name of the market (in this case) to your ingredients table as a text field so that you can use that text field to sort. It has a delay on it so it won’t work realtime with changes very well, but it should work. You don’t necessarily need to use a backend workflow for it either, you could use a frontend workflow whenever ingredients are created or edited.
This isn’t really ideal and seems like a pretty bad database practice… but it sorta works. There’s a post out there somewhere with the devs with some reasons why this isn’t available, but I wasn’t able to find just now.
Maybe someone else out there will know a better trick for this.
Hope this helps a bit,