Why did this fondue become grainy and lumpy?
I suspect that your cheese curdled.

This happens to me if I overheat the mixture- especially in the presence of acid. (I don't have any experience with using beer.) The cornstarch is there as a safety net to prevent this but obviously it is not infallible.

Turn down the heat and try adding a little more corn starch- it may not get back to perfect fondue but you may be able to pull it back to edible.