Preheat your oven to 400°F (200°C).
In a large skillet, heat the olive oil over medium heat. Add the diced onion and cook until translucent, about 5 minutes.
Stir in the minced garlic and cook for an additional 1 minute until fragrant.
Add the chicken pieces to the skillet and cook until browned and cooked through, about 6-8 minutes.
Add the sliced mushrooms and cook for another 3-4 minutes until they are soft.
Pour in the chicken broth and heavy cream, then stir in the thyme, salt, and pepper. Bring the mixture to a simmer and let it cook for about 5 minutes until slightly thickened.
Stir in the frozen peas and cook for another 2 minutes. If using, add the chopped parsley and mix well. Remove from heat and let cool slightly.
Roll out the thawed puff pastry on a lightly floured surface. Cut it into two large pieces to fit your pie dish.
Pour the chicken and mushroom filling into a pie dish and cover with one piece of puff pastry. Trim any excess pastry and crimp the edges to seal. Cut a few slits in the top to allow steam to escape.
Brush the top with the beaten egg for a golden finish.
Bake in the preheated oven for 25-30 minutes, or until the pastry is golden brown and flaky.
Allow to cool for a few minutes before serving.