Preheat oven to 220°C/200°C fan-forced. Grease a 20cm square (6cm deep) cake pan. Line base and sides with baking paper, extending paper 5cm above edges.
Line 2 baking trays with baking paper. Place pastry sheets on trays. Cover with sheets of baking paper and place baking trays on top as a weight. Bake for 25 minutes or until golden and crisp. Remove trays and top layers of baking paper, then set pastry aside for 15 minutes to cool. Using the pan as a guide, trim pastry to fit into cake pan.
Place sugar, cornflour and egg yolks in a large bowl. Whisk to combine. Add 1 cup milk, then whisk to combine. Add vanilla and remaining milk, then whisk to combine. Pour mixture into a large saucepan. Place over medium heat and whisk for 10 minutes or until mixture has thickened and is bubbling. Remove pan from heat, then add butter and whisk until smooth.
Place 1 pastry square in base of cake pan. Pour over custard and level top with a spatula. Place remaining pastry square on top and push down gently to secure. Refrigerate for 2 hours or until set.
Remove slice from pan and place on a board. Dust with icing sugar, cut into 10 squares, then serve.