Hot fudge sauce can be finicky. It can develop a grainy texture if cooked over high heat (chocolate gets scorched), cooked too long, or wasn't stirred constantly. Grains can also develop if it was cooled too quickly (refrigerated) before it had a chance to gradually cool down to room temperature. You can try to fix a gritty hot fudge sauce by adding a bit more cream and whisking vigorously until smooth.