Separate the mushroom caps from the stems. Finely chop the stems. If you have a few very small mushrooms you can chop those too and add them to the stuffing.
Blend the walnuts, garlic powder, onion powder, nutritional yeast, half a teaspoon of rosemary, half a teaspoon of oregano, salt and ground black pepper in a blender or food processor. Set aside.
Preheat the oven to 400 degrees Fahrenheit/205 degrees Celsius.
In a skillet or wok, place the olive oil with garlic and onions. Add salt and ground black pepper to season and sauté over medium heat until the onions are soft, 2-3 minutes.
Stir the chopped mushroom stems and the remaining teaspoon each of the rosemary and oregano into the onion-garlic mixture. Add the wine, if using, and sauté until it has evaporated (if using a gas stove, turn the flame to low or turn it off while adding the alcohol and turn back on to medium heat).
Stir in the red pepper flakes, if using.
Add the walnut mixture and the panko breadcrumbs to the skillet and mix well. Sauté for a couple of minutes. Check seasoning and add more salt and pepper if needed. Stir in the parsley and optional lemon zest.
Place the mushroom caps on a baking sheet. Using a spoon, mound the stuffing inside each mushroom cap.
Bake in the preheated oven for 20 minutes or until the stuffing is golden and crispy.