Preheat oven to 400°F (200°C).
In a large pot or Dutch oven, melt butter over medium heat. Sauté onion, carrots, and celery until softened, approximately 7 minutes.
Add garlic and diced potatoes; cook for an additional 2 minutes.
Whisk in flour and cook for 1 minute to create a roux, stirring constantly to prevent burning.
Gradually whisk in vegetable broth and heavy cream. Simmer until the sauce thickens and potatoes are fork-tender, about 12 minutes.
Stir in frozen peas, corn, thyme, rosemary, salt, and pepper. Remove from heat.
Transfer the vegetable mixture into a 9x9 inch baking dish or 2-quart casserole dish.
Roll out the puff pastry sheet on a lightly floured surface to fit the top of the dish. Place over the filling and crimp edges to seal.
Cut three 1-inch slits in the center of the pastry to allow steam to escape during baking.
Brush the entire pastry surface with the beaten egg wash for a golden finish.
Bake for 25 to 30 minutes until the pastry is puffed and deep golden brown.
Allow the dish to rest for 10 minutes before serving to set the sauce.