Combine the cornstarch, all-purpose flour, and half the granulated sugar in a small bowl, then briefly stir the yolks in a separate large bowl. The dry mixture should look evenly blended and the yolks should lose their separate outlines.
Warm the milk and remaining sugar in a small saucepan over medium heat, stirring occasionally, to about 120°F / 49°C without exceeding 150°F / 65°C. The sugar should dissolve completely while the milk remains below a simmer.
Whisk the dry mixture into the yolks while the milk heats. A uniform paste with no dry pockets is ready for tempering.
Whisk warm milk into the yolk paste in additions of about 1/4 cup until all the milk is incorporated. The thick paste should gradually loosen into a smooth, pourable mixture.
Cook the mixture in the saucepan over medium heat, scraping the bottom continuously, then maintain a bubbling boil for one full minute while stirring. Briefly pause to check for bubbles in the center before starting the timer, since thickening alone does not mean the custard has finished cooking.
Take the saucepan off the heat and work in the butter and vanilla. The butter should disappear into the custard, leaving a glossy mixture.
Set a large mesh strainer over a deep plate lined with plastic wrap and pass the custard through it. The strained filling should have an even texture without firm egg or flour lumps.
Lay plastic wrap directly against the custard and refrigerate for 2 hours, or use the freezer for a 30-minute quick chill. The surface covering prevents a skin, and the chilled filling should feel thick rather than flowing.