Preheat your oven to 375°F (190°C).
In a large bowl, combine almond flour, coconut flour, xanthan gum, salt, and pepper.
Cut the cold butter into the dry ingredients using a pastry cutter or two knives until the mixture resembles coarse crumbs.
Beat the egg and add to the mixture, stirring until a dough forms.
Press the dough into a 9-inch pie dish, forming an even layer on the bottom and sides.
Prick the crust with a fork to prevent bubbling and bake for 8-10 minutes, or until slightly golden. Remove from oven and set aside.
In a large skillet over medium heat, melt the butter.
Add the onion, garlic, celery, and carrots, and sauté until the vegetables are softened, about 5 minutes.
Stir in the cooked chicken, chicken broth, heavy cream, and cream cheese. Cook until the cream cheese is melted and the mixture is well combined.
Add thyme, parsley, salt, and pepper, and let the mixture simmer for another 5 minutes. If using peas, add them now and cook until heated through.
Pour the filling into the pre-baked crust, spreading it evenly.
Place the filled pie dish back into the oven.
Bake for 20 minutes, or until the filling is bubbly and the crust is a deep golden brown.
Let the pot pie rest for 5 minutes before serving.