What causes boiled frosting to become sugary as it cools? Sometimes it stays smooth and other times it’s very grainy. Thanks

I use a good digital thermometer and cook it to soft ball stage. Do you think how quickly I cool it down, when done cooking, by stirring it could make a difference?

If even one crystal of sugar doesn’t dissolve it can make your icing grainy,while the sugar syrup is boiling wash down the sides of the pan with a pastry brush and cold water to make sure no sugar is on the sides of the pan.