Chocolate can be a fine art. Gritty chocolate means that it is burning and separating. It might be worth melting the chocolate first, then slowly incorporated the cream in, but make sure the cream is not cold.
If this ever happens again, you can use a tiny bit of vegetable oil and mix it into the chocolate and it will go back together. I normally add a tablespoon at a time and stir.