1) Heat the butter in a frying pan. When foaming, add the onions and cook until soft.
2) Add the courgette and chilli to the onions and cook for a further 3-4 minutes until the moisture has left the courgettes.
3) For the pastry, roll out the chilled pastry on a floured work surface to the thickness of a pound coin.
4) Line a 20cm/8in tart ring with the pastry, taking care to push the pastry into the corners, trim off any excess hanging over the edge. Place in the fridge for an hour to rest.
5) Preheat the oven to 170C/340F/Gas 3½.
6) When rested, line the pastry case with baking parchment and baking beans (alternatively use uncooked rice or lentils). Bake the pastry blind until fully cooked and a light golden-brown colour, approximately 15-20 minutes.
7) Once the pastry is cooked, beat one of the eggs and brush with egg wash.
8) For the filling, reduce the oven temperature to 160C/320F/Gas 3.
9) In a mixing bowl, mix 85% of the the cheddar and Parmesan and onion mixture together. Add to the pastry case.
10) Whisk the cream with the egg yolks, then whisk in the remaining whole egg and the nutmeg.
11) Pour the cream and egg mixture into the tart base to fill. Bake for 20-25 minutes, or until the filing is just set.
12) Sprinkle the rest of the remaining cheese over the top and grill for 2 minutes.
13) Serve hot or cold.