Mix together the egg yolks, caster sugar, custard powder and milk in a bowl. Pour the cream into a saucepan set over a medium heat, bring to the boil, then gradually pour into the egg yolk mixture, whisking until smooth.
Pour the mixture back into the saucepan and cook over a low-medium heat for a few minutes, whisking all the time to keep it smooth. It should be very thick. Remove from the heat, then stir in the vanilla paste. Set aside to cool.
Heat the oven to 200C/180C fan/gas 4. Line a 28 x 18cm baking tray with baking parchment. Unroll the pastry sheet with the long edge closest to you. Cut it in half vertically, to make two rectangles that will fit the base of the tray. Put one sheet in the baking tray, prick all over with a fork, and bake for 15 mins. Remove from the oven and allow to cool for 5 mins.
Whisk the custard again briefly, then spread evenly over the cooled pastry. Lay the other pastry sheet on top, tucking in the edges. Brush with half the butter.
Mix the granulated sugar with the cinnamon, then sprinkle evenly over the pie. Drizzle over the remaining melted butter and bake for a further 35-45 mins until the custard has set and browned on top.
Remove from the oven and allow to cool in the tray, before cutting into bars to serve. Can be kept chilled for up to three days.