Bake the Pastry
Preheat your oven to 375°F (190°C).
Roll out the puff pastry sheets slightly to fit your baking dish.
Place each sheet on a parchment-lined baking tray, prick with a fork, and brush with beaten egg.
Bake for 12-15 minutes, or until golden and puffed. Let cool completely.
Prepare the Custard
In a saucepan, heat the milk over medium heat until it starts to steam (do not boil).
In a separate bowl, whisk together sugar, egg yolks, and cornstarch until smooth.
Slowly pour the hot milk into the egg mixture, whisking constantly to temper the eggs.
Return the mixture to the saucepan and cook over medium heat, stirring, until thickened (about 5 minutes).
Remove from heat and stir in vanilla extract and butter until smooth. Let cool slightly.
Assemble the Layers
Place one puff pastry sheet at the bottom of your baking dish.
Pour the warm custard over the pastry, spreading it evenly with a spatula.
Top with the second puff pastry sheet, pressing gently to adhere.
Add the Glaze
Mix powdered sugar, milk, and vanilla extract in a bowl until smooth.
Drizzle or spread the glaze over the top layer of pastry.
Chill and Serve
Refrigerate the assembled dessert for at least 2 hours, or until fully set.
Slice into squares and serve chilled.