Combine flour, xanthan gum, and salt in a bowl; mix well. Add butter and mix in using a pastry blender or fork until mixture resembles breadcrumbs. Stir in egg. Stir in water gradually, 1 teaspoon at a time, until moist. Knead dough until it comes together, about 3 minutes.
Dust a sheet of parchment with gluten-free flour. Place dough on top, then cover with another sheet of parchment paper. Press down lightly to form a disc. Chill in the fridge for 30 minutes.
Preheat oven to 350 degrees F (180 degrees C). Grease a 9-inch pie dish with butter.
Remove dough from the fridge and let stand at room temperature for 10 to 15 minutes; remove top sheet of parchment paper. Roll dough to 1/4-inch thick disc.
Invert the pastry onto the pie dish and press down to evenly cover the bottom. Trim excess pastry. Cover with parchment paper; fill with beans or rice.
Bake in the preheated oven until lightly golden, about 15 minutes. Remove from oven and let cool for 5 minutes. Brush bottom with Dijon mustard.
Cook pancetta in a saucepan over medium heat until crispy, about 3 minutes. Add onions and cook until translucent, about 3 minutes more.
Whisk eggs and cream together in a bowl. Season with salt, pepper, and ground nutmeg.
Layer half of the pancetta mixture and half of the shredded Gouda cheese. Repeat layers; pour in egg mixture.
Bake in the preheated oven until golden and set, about 30 minutes.