This can happen if you used granulated sweetener. to get a smooth frosting, I suggest you use a powdered sweetener such as powdered erythritol.