To make the custard, whisk the egg yolks, sugar, and cornflour in a small bowl until smooth.
Heat the milk in a saucepan over medium heat until it begins to steam, then slowly pour half into the egg mixture while whisking constantly to temper the eggs.
Return the mixture to the saucepan and cook over low heat, whisking continuously for 3 to 5 minutes until it thickens into a glossy, smooth custard.
Stir in the vanilla bean paste, transfer the custard to a bowl, cover with plastic wrap pressed directly against the surface to prevent a skin, and refrigerate until completely cool.
Preheat your oven to 180°C (350°F).
Divide your dough into 8 equal portions and roll each into a smooth ball, then flatten slightly into a disc.
Spoon a generous tablespoon of the chilled custard into the center of each disc, top with 2 to 3 fresh raspberries, and carefully fold the edges of the dough over the top to seal them into a bun.
Place the buns seam-side down on the lined baking tray, brush the tops with the beaten egg wash, and sprinkle with pearl sugar.
Bake for 20 to 25 minutes, or until the buns are deep golden brown and sound hollow when tapped on the bottom.
Allow them to cool on a wire rack for at least 15 minutes before serving to let the custard set.