The starch was never brought fully to the boil
CommonCornflour thickens as its starch gelatinises, and egg yolks contain an enzyme that breaks starch down. That enzyme is destroyed by heat, but only once the mixture has actually boiled — so a pastry cream taken off at first thickening still carries active enzyme, which digests the starch over the following hours and turns a set cream runny in the fridge. Boiling for a short period after thickening destroys it, which is why the instruction to boil is not optional and why the failure appears later rather than at the time.
What to change
Bring it to a boil and hold it briefly
Once the cream has thickened, keep it over the heat, stirring constantly, until it bubbles properly, and hold it there for a short period rather than removing it at first thickening. Stir into the corners of the pan throughout. If it looks thick before it boils, it is not finished.
Any starch-thickened egg custard: pastry cream, crème pâtissière, some pie fillings. Not applicable to custards set by egg alone, which must NOT boil.
Trade-off: The line between boiled and scrambled is narrow, and it needs constant attention rather than a timer.