Add the warm milk and stir in the yeast and sugar to the bowl of a stand mixer fitted with a dough hook. If using active dry yeast, let this sit for 5-10 minutes until foamy.
Add the egg, flour, vanilla and salt to the yeast mixture. Turn the mixer on low speed to mix until it forms a sticky, thick dough. Mix this dough for around 2 minutes to begin developing the gluten.
Next, add the room temperature butter. Turn the mixer on medium speed until the sticky dough strengthens and comes together. For best results mix the dough for at least 10 minutes for the best gluten development. It should pull away cleanly from the sides of the bowl.
Shape the dough into a ball and place it into a lightly greased bowl. Cover the bowl with plastic wrap and let it proof in a warm spot until doubled in size. You can also proof the dough in the refrigerator overnight for extra flavor.
Custard
Whisk egg yolks, sugar, spices, salt, vanilla, molasses and cornstarch in a heatproof bowl.
Heat milk in a medium saucepan on medium heat while stirring regularly until just simmering.
Gradually dribble the milk mixture into the egg yolk mixture, whisking while it's being poured in. Then return the combined mixture to the saucepan over medium heat, whisking constantly until it bubbles.
Once it starts bubbling, it will begin to thicken. Keep it at a bubble don't stop whisking for 1 minute.
Pour the hot pastry cream into a clean bowl. If you want an extra silky smooth texture, you can push it through a fine mesh sieve first. Lay a piece of plastic wrap directly onto the surface of the custard to avoid skin forming.
Let it come to room temperature, then chill it in the refrigerator until completely cold.
Shaping
Punch down the dough on a lightly floured surface. Roll it into a ½-inch thick rectangle. Use a cookie cutter to cut out 3.5-inch rounds, placing each on parchment paper. Knead any scraps into a ball, rest, then roll again.
Let cut doughnuts rest for 30-60 minutes until puffy, cutting around the parchment paper with kitchen scissors so each doughnut is on a separate piece.
Heat around 3 inches of oil in a deep fryer or deep saucepan to 340°F - 347°F. Carefully add in 2-3 doughnuts into the hot oil, removing parchment with tongs. Fry for 2 minutes until deep golden brown, flip, and fry for another 2 minutes. Keep oil hot but under 350°F.
Remove the fried donuts with a slotted spoon, then place them on a wire rack on a paper towel.
In a small bowl, mix caster sugar or granulated sugar with cinnamon. Toss them into the cinnamon-sugar mixture to coat.
Filling
Fill the doughnuts only once they have cooled and the custard has chilled. Give the cold custard a whisk to loosen it up, then spoon into a piping bag with a round tip.
Insert the tip of a small knife into the sides of the cooled doughnuts to make a hole for the filling. Pipe the custard through the hole into each doughnut.
Notes
Storing - Once filled, gingerbread doughnuts are best served on the day they are made. Store any leftover doughnuts in an airtight container in the refrigerator. *The cup sizes given are US sizes, note that these are smaller than metric. For best results use grams.