Prepare the custard while the dough is resting. Mix the cornflour, plain flour, and half of the sugar in a small bowl.
Place the egg yolks in a large bowl. Stir a few times to mix the yolks.
Add the milk and the remaining half of the sugar into a small saucepan. Heat over medium heat. Stir occasionally to dissolve the sugar completely. Cook until it reaches about 120 °F/ 49 °C (no more than 150 °F / 65 °C). You might see a few bubbles here and there. If the milk starts foaming, it’s too hot.
While the milk starts to get warm, add the dry ingredients (from step 1 of the custard) into the bowl with the egg yolks. Whisk until it forms an even paste. Do not add the dry ingredients too early, because the sugar will change the texture of the eggs.
Add the warm milk into the egg yolk mixture, about 1/4 cup at a time. Whisk constantly until the milk is fully incorporated into the paste. Continue to add more milk, a 1/4 cup at a time, and continuously stirring, until it forms a thin, smooth mixture and all the milk is added.
Return the mixture to the pot (the one you used to heat the milk). Heat over medium-low heat and stir constantly, until the mixture thickens, 5 minutes or so. Keep cooking and stirring until you can draw a line on the bottom of the pot using a spatula. Remove the pot from the stove immediately. Add the butter and vanilla extract. Stir to mix well.
Line a large, deep plate with cling film and pour the custard into it.
Cover the custard with cling film and press it against the custard, so it won’t form a skin once it’s chilled.
Chill the custard in the fridge until it’s cooled, 2 hours or so. Or in the freezer for 30 minutes.