This can occur if the mixture is stirred too much after the sweetener has dissolved or if it cools down too quickly. Using a smooth-bottomed pot and consistent heat can help.