Science, not luck - two layers of it.
First: the spice isn't sitting on hot dry metal, it's sitting on DOUGH - which spends the whole bake releasing steam. That evaporating moisture keeps the surface meaningfully cooler than the oven's air temperature, so the spice toasts (deepening colour and aroma, which you WANT) rather than scorching. Second: baking temperatures around 200°C for 20-25 minutes are simply below the incineration zone for robust ground spices - chilli, turmeric, jeera powder are sturdy customers.
The exception worth knowing: DELICATE dried herbs - parsley, coriander leaf, kasuri methi in thin flakes - are thin enough to scorch bitter. Those go on after baking, or in the final minutes.
So your straws were never in danger. Robust spices before, fragile herbs after, and the steam handles the rest 🌶️