Preheat the oven to 400 degrees. Toss the butternut squash with 1 tablespoon of the olive oil and place on a baking pan. Toss the onion wedges with the remaining tablespoon of olive oil and place on another baking pan. Bake the vegetables in the oven until they are tender, about 20 minutes. Baking times may differ, test with a knife for tenderness. Let cool.
Line a 10-inch pie pan with pastry dough while the vegetables are roasting. Let rest in the freezer for 10 minutes. Line the pastry with foil and fill with pie weights or dried beans. Bake for 20 minutes to set crust. Remove the foil and beans and bake for another 10 minutes. Set aside and reduce oven temperature to 350 degrees.
Sauté the pancetta or bacon until brown and crisp while crust is baking. Pour the fat out of the pan. Sauté the spinach in the skillet with the pancetta until just wilted, set aside. In a large bowl, whisk together the thyme leaves, eggs, cream, milk, salt, pepper and nutmeg.
Sprinkle 1/4 cup of the grated cheese on the bottom of the prebaked piecrust. Top with the roasted squash and onions. Sprinkle the rest of the cheese over all. Top with the spinach mixture. Pour the egg mixture over all and bake for 45-50 minutes or until the custard is set. Custard is set when a knife inserted in the center comes out clean. Let rest 10 minutes before cutting.