Melt the butter in a large skillet over medium heat. Add the onion and cook until softened. Stir in the garlic, carrots, potatoes, and green beans. Cook for 5–7 minutes until the vegetables begin to soften.
Sprinkle the flour over the vegetables and stir well. Slowly pour in the vegetable broth while stirring continuously. Add the milk, thyme, rosemary, salt, and pepper. Simmer until the sauce thickens. Stir in the peas and remove from heat.
Transfer the vegetable filling into a pie dish or baking dish. Lay the puff pastry over the top and trim any excess. Press the edges gently to seal and cut a few small slits in the center to allow steam to escape.
Brush the top with beaten egg or milk. Bake in a preheated oven at 400°F (200°C) for 25–30 minutes, or until the crust is golden brown and flaky.
Allow the pot pie to rest for 5–10 minutes before serving. This helps the filling set and makes it easier to slice.