This is likely because you cooked the mixture on high heat or for too long. Please make sure you are only cooking on the lowest heat setting for just 1-2 minutes. We don't want to caramelize the sugar, we are just facilitating the dissolving process. If in doubt, remove the butter from heat, and then whisk in the sugars.