What happens is when you bag 12 quarry bushes you get a stack of 60 leaves, this turns into a lavish roast so large it can't fit in a barrel.
Oh yeah, I hadn't thought about that specific problem. There are probably other plant types that process into stacks based on their input stack size which might cause problems.
The reason I picked 12 is as you suspected: brewing is done in multiples of six, so picking a multiple of six for the combined stack size allows two maximum-size brewing jobs to happen in a single hauling action (for the plant, at least). With fertiliser and a high farming skill it's possible to get stacks of 9 or 10, so 12 isn't a significant difference. (And, no, the script doesn't break if you have unusually large stack sizes in the container. Though, it may choose to take items from those large stacks to merge into smaller ones.)
Maybe this should be reported as a bug, actually—brewers obviously split stacks to ensure that drink doesn't exceed barrel capacity (although, they don't take into account the larger capacity of a pot), so maybe cooks should do the same thing.
When you say the lavish roast can't fit in a barrel, are you sure it isn't getting stored? I know I've cooked roasts larger than a barrel's maximum capacity (usually because my cook selected a full barrel of 30 drinks for one of the inputs) and they've gone into a single barrel just fine. I'm pretty sure the maximum capacity is just a limit for adding more items. So you'll end up with a barrel just containing your one giant roast.
I might have to change the script to better handle barrel capacity regardless, because I realised yesterday that it's not doing that properly. Because of the way it processes items, it has a high chance of filling barrels past their capacity. As near as I can tell, this doesn't cause any problems, but it does violate the simulation's mechanics in a way I don't like. I've got a couple ideas of how to handle that, but not much time to implement them. If anyone can confirm that over-capacity containers are causing problems, I'll try to squeeze in the time to fix it as soon as I can, otherwise I might have to put it off for a week or two.
In the meantime, you can use the -max parameter to manually set the desired stack size. That's the main reason I separated the drinks and plants versions of the script, so you could individually change the stack size for them. Later, I might add the option to specify maximums for specific plant types, so you can ensure that quarry bushes only get combined into stacks of 6, but leave strawberry plants in stacks of 12.