Preheat the oven to 180°C (350°F).
Line a 9-inch pie dish with the puff pastry, trimming any excess.
In a saucepan, heat the milk over medium heat until it just begins to simmer. Remove from heat.
In a bowl, whisk together the sugar, eggs, vanilla extract, and cornstarch until smooth.
Gradually pour the hot milk into the egg mixture, whisking constantly to prevent curdling.
Pour the mixture back into the saucepan and cook over medium heat, stirring continuously, until thickened.
Remove from heat and stir in the butter until fully melted and incorporated.
Pour the custard into the prepared pie dish and smooth the top.
Bake in the preheated oven for 40-50 minutes, or until the top is set and lightly browned.
Allow to cool at room temperature before refrigerating for at least 2 hours before serving.