Preheat the oven to 200°C. Line a 20cm x 30cm shallow baking tin with baking paper. Roll out the pastry so that it fits into the tin, pushing it into the corners and up the sides. Cover with a scrunched up piece of baking paper, line with baking beans and bake for 15 minutes. Remove from the oven, tip out the baking beans and paper and bake for a further 10 minutes, until the pastry is golden and crisp. Leave the oven on.
Heat the oil in a large non-stick frying pan over high heat. Add the garlic and, after a few seconds, the spinach. Cook, stirring, for 1–2 minutes, until wilted then add a grating of fresh nutmeg and stir well. Drain on paper towel to remove any excess water.
Mix together the egg, mascarpone and most of the parmesan and pour into the pastry shell. Dot over the cooked spinach and sprinkle with the remaining parmesan and the chilli, if using. Bake for 25–30 minutes, until the filling is just set. Allow to cool for a few minutes before slicing and serving.