Make the dukkah: Preheat the oven to 350˚ F. Pour the hazelnuts onto a baking sheet, then slip into the oven and toast until golden brown and fragrant, about 12 minutes. Pour the nuts onto one half of a clean kitchen towel, then fold over the other half. Rub gently to remove the skins. Pour the nuts onto a cutting board, finely chop and set aside.
Set a cast-iron skillet over medium heat. Add the coriander seeds and toast, 1 to 2 minutes. Add the cumin seeds and sesame seeds and cook, stirring often, until fragrant and slightly darker in color but not burned, 2 to 3 minutes. Stir the seeds with the hazelnuts, then coarsely grind with a mortar and pestle. Set aside.
Make the pie: Increase the oven temperature to 400˚ F. Set a large skillet over medium heat. Add the butter and cook until melted and browned just a little. Add the shallots and garlic; cook, stirring, until softened, about 3 minutes.
Rinse the spinach. Drain, but don’t worry about getting all the water off. Add the spinach to the shallot-garlic mixture in batches, stirring, until all of the spinach is wilted, 7 to 8 minutes. Stir in the dill and nutmeg; season with salt and pepper. Drain off any excess liquid. Remove from the heat and let cool slightly.
Add the mozzarella and cheddar to the spinach. Stir well and let cool. (You can pop it into the fridge to hurry this along!)
Place one puff pastry sheet in the bottom of an 8-inch square baking dish or 9-inch pie plate. Spoon in the spinach filling, using the back of a spatula to level it out. Layer the other puff pastry sheet on top, and then crimp the edges, cutting off any excess. Brush the beaten egg on the puff pastry and sprinkle with the dukkah spice blend. Put the pie on a baking sheet and bake until deep golden brown, 30 to 40 minutes. Sprinkle with the sumac. Let cool 10 minutes before cutting into the pie.