Preheat the oven to 400°F and lightly grease a 9-inch pie dish or baking dish.
Melt the butter in a large skillet over medium heat. Add the onion, carrots, and celery, then cook for 5 minutes until the vegetables begin to soften.
Sprinkle the flour over the vegetables and stir for 1 minute to form a roux.
Gradually whisk in the chicken broth and heavy cream. Continue stirring until the mixture thickens, about 3 minutes.
Stir in the shredded chicken, frozen peas, and dried thyme. Season with salt and black pepper to taste, then remove the skillet from the heat.
Pour the filling into the prepared dish. Lay the puff pastry sheet over the top and trim any excess edges. Cut a few small slits in the pastry for steam to escape.
Brush the top of the pastry with the beaten egg. Bake for 25 minutes until the crust turns golden and the filling bubbles at the edges.