Preheat the oven to 200°C/fan 180°C/gas mark 6. On a baking tray, toss together the squash, garlic cloves, chilli and ½ tbsp oil, seasoning well. Bake for 30-35 minutes until tender. Transfer to a bowl and squeeze out the garlic flesh. Roughly mash it all together with a fork. Set aside.
Meanwhile, heat a griddle pan over a medium heat. Toss the courgette in the remaining oil and season well. Grill the courgette for 2-3 minutes on each side until grill lines appear. You may need to do this in two batches. Set aside.
Preheat your grill to medium high. Place the peppers on a baking tray and place under the heat. Grill for 15 minutes, turning every so often, until the peppers are blackened. Transfer them to a plastic food bag and seal. Leave for 20 minutes until the skins get loose. Remove the stalks and skins and cut the flesh into wide strips, discarding the seeds and core.
Cook the spinach in a microwave according to the instructions on the packet. Allow to cool slightly, then squeeze out as much liquid as possible. Transfer to a large bowl and combine with the ricotta and nutmeg.
Prepare one sheet of the ready-rolled pastry by gently rolling out with a rolling pin. Line an 18cm round springform tin with the pastry. Spread the base with the butternut mash, then add a layer of red pepper, followed by the mozzarella, the courgette and finally the ricotta mixture, being sure to season between each layer.
Cut a 20cm circle from the other roll of pastry – it needs to be big enough to cover your pie with a small overhang. Brush the edge of the pie with egg and top with the pastry lid. Seal and remove any excess with a sharp knife. Crimp the edges with your fingers to completely enclose, then cut a small cross in the middle to allow steam to escape during cooking. Brush the top with egg and bake for 50-60 minutes or until the crust is golden and crisp.
Remove from the oven and leave in the tin for 20 minutes, then remove from the tin and allow to cool completely. Cut into slices to serve.