Arrange the sliced aubergines on a foil-lined grill rack, drizzle with 2 tablespoons oil and sprinkle with salt and pepper. Grill for 5 minutes until browned, turn over, oil and season again, grill for a further 5 minutes, then set aside.
Heat the remaining oil in a saucepan, add the onion and fry for 5 minutes until softened. Add the garlic, tomatoes, wine, sugar and rosemary, then season well with salt and pepper. Simmer, uncovered, for 15 minutes, stirring from time to time until thickened, then leave to cool.
Make the pastry. Add the flour and a pinch of salt to a bowl, then rub in the fats with your fingertips or an electric mixer until you have fine crumbs. Stir in the Parmesan and rosemary, then mix in enough of the water to form a soft but not sticky dough. Knead lightly, then cut in half.
Roll one pastry half out thinly on a lightly floured board until large enough to cover a buttered 25 cm (10 inch) metal pie plate. Lift the pastry into the pie plate, then spoon one-third of the tomato sauce over the base. Arrange half the aubergines on top, cover with half the remaining sauce, then the red peppers. Repeat with the remaining aubergines and sauce.
Roll out the remaining pastry to form a lid. Brush the edge of the pastry on the plate with beaten egg. Lift the pastry over the pie, press the edges together and trim off any excess. Brush the top of the pie with egg, and sprinkle with rosemary and a little extra Parmesan.
Bake in a preheated oven, 190°C (375°F), Gas Mark 5, for 30–35 minutes until golden. Check after 20 minutes and cover with foil if needed. Serve hot cut into wedges.