You can try to strain the pastry cream through a fine-mesh sieve a couple of times. If it doesn't work, the cream was overcooked at above 185°F (85°C), and you can't revive it. So the cream has to be redone.