Preheat the oven to 375°F and grease a 9x9 inch baking dish.
Melt the butter in a large skillet over medium heat. Cook the onion, celery, carrot and mushrooms for 7 to 8 minutes until softened, then add the garlic and cook for 1 minute.
Pour in the chicken broth, heavy cream and cream cheese and stir until smooth. Sprinkle in the xanthan gum while whisking, then add the thyme, salt and pepper and simmer for 4 to 5 minutes until thick and creamy.
Stir in the chicken and green beans and pour the filling into the baking dish.
For the crust, microwave the mozzarella and cream cheese in 30 second bursts, stirring between each, until fully melted. Stir in the almond flour, egg and garlic powder and knead into a smooth dough.If the dough feels too sticky, chill it for 10 minutes before rolling.
Roll the dough between two sheets of parchment to the size of the dish. Lay it over the filling, tuck in the edges and cut a few small slits on top so steam can escape.
Brush with the beaten egg and bake for 20 to 25 minutes until the crust is deep golden. Let it rest for 10 minutes so the filling sets before serving.