Pre-heat your oven to 180C Fan/400F/Gas Mark 6
Place the diced butternut squash onto a baking tray and roast for 15-20 minutes or until tender, set aside to cool
In a pan, heat the oil on a low-medium heat. Add the leeks and nutmeg, cook for around 8 minutes until the leeks have softened, set aside to cool
To make the pastry, place the flour and salt into a mixing bowl, then add the butter
Using your fingers, rub the butter into the flour until it resembles breadcrumbs
Add the egg and milk, and mix until a dough is formed. If it is too dry, add a little more milk
Split the dough, use about ⅔ of it for the pie base. Wrap the rest in cling film and put in the fridge
Roll the dough out for the base on a lightly floured surface, line a pie tin with the dough and trim the edges, leaving a little over hang. (You can add any trimmed pastry to the reserved pastry for the lattice top). Place in the fridge for 30 minutes
Once the squash and leeks have cooled and the pastry is chilled, and you are ready to assemble, pre-heat your oven to 200C Fan/425F/Gas Mark 7
In a mixing bowl, add the leeks, butternut squash, ricotta, pecorino, sage, thyme and salt. Mix together
Fill the pastry base with the mixture
Roll out the remaining pastry and cut into even sized strips, about 1 inch wide
Place four strips vertically and evenly spaced over the pie, fold back two alternate strips
Place one strip of dough horizontally towards one side of the pie and pull the two folded back strips over it. Then fold back the two other strips
Place another piece of dough horizontally across the pie and pull the two folded back strips over it, then fold back the other two strips. Keep repeating this process until you have four vertical and four horizontal strips inter weaving across the pie
Trim the edges of the strips so they meet the pie edge, use the beaten egg to stick them to the overhanging pastry of the pie base and then glaze the top of the pie with beaten egg all over the pastry
Bake for 30-35 minutes until deep golden all over. If the pie browns too quickly on the edges, you can cover it with foil or use a pie shield
Serve warm, or allow to cool fully and store in the fridge for 3 days