Melt the butter over medium heat, being careful not to burn it. Sauté onions for 2-3 minutes, then add garlic and cook for about 1 minute. Add mushrooms and thyme. Cook, stirring occasionally, until mushrooms are toasty brown, about 7 minutes. Add flour, salt, and pepper, and stir for another 2 minutes until the flour is thoroughly incorporated.
Add wine and reduce by half, about 3 minutes. Reduce heat to low, then add cream, soy sauce, fish sauce, milk (If using) and fried onions. Stir, season, and simmer for 10-15 minutes.
While you are waiting for your sauce to thicken, blanch your green beans in boiling salted water for 3 minutes, then drain and cool. If you like your green beans on the squeaky crunchy side, use an ice bath. Preheat your oven to 375ºF too.
To assemble: make a bed of green beans in a large oven proof dish. Ladle the mushroom sauce over top of that, and top with parmesan. Bake for 30 minutes at 375ºF.
Remove from oven, carefully toss the green beans a little, then top with more onions. Return to the oven for another 5 minutes or until onions are crispy.
Add milk if you prefer your casserole on the saucier side, leave out if you prefer your casserole thicker. Pictured with no milk added.