Bring milk, half the sugar, and vanilla to simmer.
In another bowl, whisk egg yolks along with the rest of sugar, then add the flour and cornstarch. Whisk thoroughly until smooth and light in colour.
Slowly temper the yolk mixture with hot milk whilst whisking, then return mixture to the saucepan over a mesh strainer.
Bring back on to the heat and cook over medium-high, whisking constantly, until it boils and thickens. Should take about 2-5 minutes.
Remove from heat, whisk in half the butter (≈150 g) until smooth. NOTE 3
Transfer to a shallow dish to cool, cover with cling film touching surface to prevent a film from forming over the custard, and chill completely.
Once cool place the custard back into a stand mixer or bowl and whip the custard until smooth, then gradually add the remaining butter (≈150 g, must be very soft, room temp), beating until glossy and fluffy. Do not use COLD custard and soft butter otherwise you will find a grainy texture. Note 4
Add the pistachio paste and beat until incorporated and place into a very large piping bad.