I think I found out something quite interesting, I messed around with the reaction a bit, changing it to create cheese bolts:
[REACTION:CRAFT_BOLTS_CHEESE]
[NAME:craft cheese bolts (25)]
[BUILDING:GRINDER:CUSTOM_A]
[REAGENT:A:1:CHEESE:NONE:NONE:NONE]
[PRODUCT:100:25:AMMO:ITEM_AMMO_BOLTS_CHEESE:GET_MATERIAL_FROM_REAGENT:A:NONE]
[SKILL:CHEESEMAKING]
This time the dwarf carried a stack of 5 yak cheese to the workshop, and created one stack of 125 yak cheese bolts and consuming the entire stack of 5 cheese.
And changing the last reaction to this (removed [USE_BODY_COMPONENT] tag and changed reagent amount to 1) :
[REACTION:CRAFT_STACKED_BOLTS_BONE]
[NAME:craft stacked bone bolts (25)]
[BUILDING:GRINDER:CUSTOM_A]
[REAGENT:1:5:NONE:NONE:NONE:NONE][ANY_BONE_MATERIAL]
[PRODUCT:100:25:AMMO:ITEM_AMMO_BOLTS_STACKEDBONE:GET_MATERIAL_FROM_REAGENT:A:NONE]
[SKILL:BONECARVE]
First the dwarf creates a stack of 25 bone bolts out of any stack of bone. If the reaction is repeated, the dwarf uses the 25 bone bolts stack, and creates a stack of
625 bone bolts out of it.
So I'm guessing the treating-stack-as-one-item problem only exists on bone/shell/tooth/horn stacks? At least cheese stacks work correctly (Well, not exactly correctly, but the game recognizes the number of items in the stack). I... have absolutely no idea what to make of this.
EDIT: Perhaps making a reaction to take up 5 stacks of basic bone bolts and output 1 stack of 25 bone bolts (using another item token) will work? It's a bit of a lousy solution, and I don't know if you can actually distinguish between items like that. I'll probably try it out later.