Ganache can become gritty when the chocolate has seized. This usually means the chocolate has come into contact with water. While it's true that water causes chocolate to seize, it can also solve gritty chocolate. Add a teaspoon of boiling water to the ganache to smooth it out. Repeat this as necessary to achieve the best texture.