It is recommended when roasting whole spices in Indian cooking to cool them before grinding into a powder. Why do you need to wait for the spices to cool and what happens if you don’t?
The reason to wait is that warm spices tend to clump when grinding, and the cooling step should help avoid this. I have a bladed coffee grinder that I use as a spice grinder. I rarely wait for toasted spices to cool. Sometimes they do clump in the grinder. I don't find it a problem, and just wipe out the ground, but sometimes stuck spices.