Preheat the oven to 425.
Heat the olive oil in a 9-inch cast iron skillet. Add the onions, celery, and carrots, cooking until vegetables are softened and the onions have started to brown, about ten minutes.
Add the mushrooms, cooking until dark and softened.
Stir in the corn, cook until warmed.
Move the vegetables to the side, add the chicken (or potatoes for vegan). Sprinkle with rosemary, sage, salt and pepper, cooking until chicken is mostly cooked through (or potatoes are fork tender.
Sprinkle with flour. Add the stout, scraping the bottom to de-glaze the pan. Add in the chicken broth, allow to simmer until slightly thickened. Remove from heat.
Roll the puff pastry out on a lightly floured surface, transfer to the skillet, making sure the entire top is covered and the pastry is hanging over the sides.
Brush with egg wash. Slit a few holes in the top with a sharp knife. Bake until puff pastry is golden brown, about 12 minutes. Serve warm.