Preheat your oven to 375°F (190°C).
Begin with the crust by combining almond flour, coconut flour, and salt in a large bowl.
Add the cold, cubed butter to the flour mixture and use a pastry cutter or your fingers to blend until it resembles coarse crumbs.
Mix in the beaten egg until a dough forms. If the dough is too sticky, add a bit more almond flour until it's workable.
Press two-thirds of the dough into the bottom and sides of a 9-inch pie pan, saving the remaining dough for the top crust. Poke a few holes in the bottom with a fork and pre-bake for 8 minutes.
While the crust is pre-baking, heat olive oil in a large skillet over medium heat. Sauté the onions until translucent, then add garlic and cook for another minute.
Add the cubed chicken to the skillet and cook until it's no longer pink.
Stir in the sliced mushrooms and cook until they release their moisture and start to brown.
Pour in the chicken broth and heavy cream, bringing the mixture to a simmer.
Sprinkle in the xanthan gum, thyme, rosemary, and season with salt and pepper, stirring well until the sauce thickens.
Remove the skillet from heat and let the filling cool slightly.
Spoon the chicken and mushroom filling into the pre-baked crust.
Roll out the remaining dough between two pieces of parchment paper and place it over the filling, crimping the edges to seal. Cut slits in the top to allow steam to escape and brush with egg wash.
Bake for 25-30 minutes or until the crust is golden brown and the filling is bubbling.
Let the pie cool for 10 minutes before serving.