Preheat the oven to 180°C (160°C fan). Lightly grease a 22–24 cm pie dish.
Make the pastry: combine cake flour, baking powder, sugar, cayenne and salt. Rub in the 120 g butter until the mixture comes together as a short, crumbly dough. Press it evenly over the base and up the sides of the pie dish. If it will not hold together, chill briefly before pressing; do not add liquid.
Make the white sauce: melt 2 tbsp butter over medium-low heat. Stir in 2 tbsp flour and cook for 1 minute without browning. Gradually whisk in the milk, then add ¼ tsp salt. Stir until smooth and thickened. Remove from the heat.
Fold the chopped cooked ham, grated cheese, parsley, mustard and pinch of cayenne into the béchamel sauce. Spoon the filling evenly into the prepared pastry case.
Bake for approximately 30 minutes, until the pastry edges are golden and the filling is hot and lightly coloured. If the pastry needs longer, bake for a few additional minutes. Rest for 5–10 minutes before slicing into 6–8 portions.