Are you channeling your best self with this comment? (If you're not sure, check out our Code of Conduct.)
Lisanne is a trusted home cook.
Fine, well-aged cheeses have some grit and crunch to them. I googled and found this article which relates that they are due to tyrosenes, amino acid clusters that form during the aging process:https://www.thekitchn.com... . Perhaps that is what you are noticing in your mac and cheese.
It could be caused by aged cheese, but what recipe do you use? Do you use flour/butter to make a roux? The flour may be undercooked, or the milk may hit too high of a temperature and can be curdling.
You don't mention what type of cheese you are using but Martha Stewart has a great Mac & Cheese recipe using a mix of cheddar & gruyere. She does note on her site that you should not use extra sharp cheddar - I use sharp and have never had a gritty result.
I find that when I let my cheese sauce get “too hot” it becomes grainy. If I allow it to boil before adding it to macaroni, cook it in too hot an oven, or reheat it above 60% power in the microwave (YMMV) it breaks down and becomes grainy. HTH!
Could be that as well as not having gentle enough heat after adding the cheese.
Definitely the cheese. You don’t specify which you use. Martha Stewart says no extra sharp cheddar, I say no sharp cheddar. I find the “sharps” get bitter when melted. Melted Fontina is good. A strong flavor without bitterness. Usually I use Tilamook cheddar and add Fontina if I need more.
The cheese would be the number one suspect here. That, and over-heating it. If you add cheese to a white sauce (bechamel) and then bring it to a hard boil, it will certainly break down and become gritty. (Lidia Bastianich insists on offing the heat after adding cheese to a dish on the stove). Also, the type of cheese could be the culprit. Years ago at a restaurant where I was a chef, customers were complaining that my Mornay sauce was gritty. Couldn't understand why since I had never had that problem before. Turns out it was the brand of Parmesan that the restaurant used, because it did not melt. I brought it to the attention of the owners, they changed brands, and my cheese sauce was as smooth as silk ever after. I'm pointing this out because it may not necessarily be the TYPE of cheese, but the BRAND. ALL cheeses, as well as other products, vary wildly from brand to brand.
FYI - you will also get grit if you mishandle your roux. Slow and gentle heat, please!