Set a rack on the lower one-third level of the oven and preheat to 350°F [177°C].
Set a large pot of salted water to boil over medium-high heat. Add the diced potatoes and cook until they are just tender but retain their structure, 4 to 5 minutes. Drain the potatoes.
Heat the olive oil in a medium saucepan over medium-high heat. Add the onions and sauté until they turn pale and translucent, 4 to 5 minutes. Lower the heat to medium-low and add the ginger, garam masala, black pepper, turmeric, and chili powder. Sauté until the spices are fragrant, 30 to 45 seconds. Add the potatoes and cook for 2 minutes, until they are completely tender in the center. Add the spinach and cook until the leaves have wilted and released most of their liquid, 2 to 3 minutes. Fold in the chickpeas and amchur, season with salt, and cook for about 1 minute. Remove from the heat. Add the cilantro and chili. Taste and season with salt if needed.
To prepare the phyllo crust, combine the butter and olive oil in a small bowl. Brush a 9- by 12- by 2-in. [23 by 30.5 by 5 cm] rectangular baking pan with the butter–olive oil mixture. Line the base of the pan with 5 sheets of phyllo, brushing each sheet with a little bit of the butter–olive oil mixture. Make sure any overhanging phyllo sheets are also brushed with the mixture. Add the chickpea mixture and level it with a large spoon or spatula.
Add the remaining phyllo sheets on top, brushing each with the butter–olive oil mixture. As you place each one, pleat slightly to create a ruffled surface. Sprinkle the cumin and nigella seeds on top. Fold in any overhanging phyllo and neatly tuck them in around the sides. Bake the pie in the preheated oven until the crust is golden brown on top and on the sides, 30 to 45 minutes, rotating halfway through baking. Let cool in the pan for 5 minutes before serving.
The pie is best eaten the day it is prepared.