Mix together oil, flour, panko, and seasoned salt together in a large bowl, until well combined.
Very thinly slice onions, using a mandoline, or a very sharp knife into ⅛-inch thick slices. Separate the slices into individual rings and place them into the breading mixture and toss to coat.
Shake off the excess bread crumbs from the onions and spread them out onto a baking sheet and bake for 10 minutes. Remove from the oven and reduce heat to 375 degrees F.
Prepare Green Beans
While the onions are cooking, fill a large stock pan with water and bring to a rapid boil. Add the trimmed beans to the boiling water and cook for 3 minutes for thin green beans or 5 minutes for thicker green beans. Immediately transfer the beans to a large bowl or ice water, using a slotted spoon.
Melt the butter in a heavy-bottomed stock pan over medium heat. Add the mushrooms and thyme leaves and saute until mushrooms are beginning to soften for about 5 minutes.
Whisk the flour into the pan to form a thick paste or roux. Allow the mixture to cook for 1 minute.
Slowly whisk in marsala wine (or stock), whisking until smooth and thick paste forms. Gradually add the stock and milk, whisking well. Add in the salt, pepper, garlic powder, and onion powder and stir well.
Bring the mixture to a boil over medium-high heat and whisk well until the mixture is thickened, anywhere from 2 to 5 minutes. Remove from heat.
Assemble Casserole
Lightly grease a two-quart baking dish.
Drain the green beans from the ice water and pat dry.
Add green beans to the mushroom sauce and toss to coat. Pour the green bean mixture into prepared casserole dish. Top evenly with onions.
Bake at 375 degrees F for 30-35 minutes until warm and bubbly and topping is browned.
Notes
For the stock, use mushroom broth, vegetable broth, or chicken broth.Marsala Wine: Use a dry Marsala or in place of the wine, use additional broth. Stock, Vegetable Stock or Chicken Stock. If not using Marsala Wine, use additional stock. Thyme: The fresh thyme leaves add depth to the homemade mushroom sauce but feel free to omit.Frozen Green Beans: If using frozen green beans, use 16-20 ounces of frozen green beans and precook them following the instructions for fresh green beans.Canned Green Beans: Canned green beans are not recommended for the best flavor, but can be used. Drain two 15-ounce cans of green beans and mix them in with the mushroom sauce. There is no need to blanch canned green beans. To prepare up to 24 hours in advance: Prepare the green beans, sauce, and homemade fried onions as directed. After the sauce is finished, toss the green beans with the mushroom sauce and pour them into the prepared casserole dish. Top with the onions and cover tightly with plastic wrap and refrigerate overnight. The next day, remove the casserole from the fridge while the oven preheats to 375 degrees F. Bake for 40-45 minutes.Storage: Leftover green bean casserole will keep in the fridge in an airtight container for 3-4 days.