Preheat the oven to 400 degrees Fahrenheit and set a 9-inch pie dish nearby.
Melt the butter in a large skillet over medium heat. Add the onion, carrots, and celery, then cook for 4 minutes until they begin to soften.
Stir in the mushrooms and garlic. Cook for another 5 minutes until the mushrooms release their liquid and start to brown.
Sprinkle the flour over the vegetables and stir for 1 minute to coat everything evenly.
Slowly pour in the chicken broth while stirring, then add the heavy cream. Continue stirring until the mixture thickens, about 3 minutes.
Add the shredded chicken and thyme. Season with salt and pepper, then remove the skillet from the heat.
Transfer the filling to the pie dish. Lay the pie crust over the top, trim any excess, and crimp the edges. Cut a few small slits in the center for steam.
Brush the crust with the beaten egg. Bake for 25 minutes until the crust is golden and the filling bubbles at the edges.