Preheat the oven to 400 and butter an approximate 9x9 casserole dish.
Lets make Crispy Onions!:
Toss the shallots or onions in the flour, salt and pepper. Heat a large cast iron skillet over medium high heat and then add the oil. I add enough oil so it reaches about 1/4" up the sides of the pan. When the oil is very hot, add the onions. I fry about a handful at a time and in a single layer and until nicely golden brown. Repeat with the rest of the onions and set on a plate lined with a paper towel~ set aside. Wipe out your cast iron for the cream sauce.
Mushroom Cream Sauce:
In the wiped out cast iron skillet, melt the butter on medium high heat. Fry the mushrooms and salt and pepper to taste until golden ~ don't crowd them in the pan or they will just steam. You want to brown them. Give them color.
Add the garlic and saute for a minute or two. Don't burn the garlic.
Add the flour and cook the flour and mushroom mixture until the mushrooms are coated.
Add the stock a little at a time and bring to a simmer
Add the heavy cream and thyme and salt and pepper to taste again. The sauce will thicken and bubble. About 5 minutes.
Remove from the mushroom cream from heat and add the steamed green beans. Toss until the beans are coated nicely with the cream sauce. Pour into the buttered casserole and top with the crispy shallots.
* Bake for approx 10-20 minutes until the sauce bubbles again and the onions begin to brown a little more. ( the should be a nice golden brown)