Preheat oven to 375 degrees. Press the pie crust into a 9- or 9½-inch tart pan with a removable bottom. Place on a baking sheet and prick the bottom several times with a fork. Line with parchment paper and fill with pie weights, dried beans, or rice. Blind bake for 15–18 minutes. Remove the parchment and weights and bake for another 5–8 minutes, or until the bottom is dry and lightly golden. Set aside and let cool.
Sprinkle the Parmesan cheese over the bottom of the crust.
Toss the butternut squash with 2 tablespoons of olive oil and season with salt and black pepper. Spread it on a baking sheet in a single layer. Roast for 20–25 minutes or until just tender and lightly browned around the edges. Avoid overcooking so it doesn't get mushy. Prop up one side of the baking sheet with a folded kitchen towel to allow any excess oil to drain to the opposite side. Let cool.
While the squash roasts, heat the remaining olive oil and butter in a skillet or sauté pan over medium heat. Add the cleaned, sliced leeks and a pinch of salt. Reduce heat to medium-low and cook for 12–15 minutes or until very soft, stirring occasionally. Avoid browning the leeks, adding a splash of water if necessary. Add the garlic during the last minute and cook until fragrant. Remove from the heat, drain off any excess fat, and let cool slightly.
Reduce oven temperature to 350 degrees.
Gently combine the roasted butternut squash, leeks, and Gruyère or Cheddar in a large bowl. Transfer to the prepared tart crust, spreading evenly and pressing down gently to compact the filling without crushing the squash. Do not overfill.
Place the beaten eggs in a 1-cup liquid measuring cup. Add enough half-and-half to bring the total volume to 1 cup. Season with salt and black pepper, and whisk to combine. Slowly pour over the vegetable and cheese mixture, allowing the custard to settle between the ingredients.
Bake for 35–40 minutes, or until the custard is set and the top is lightly golden.
Let rest for 10–15 minutes before removing the tart pan ring and slicing.