Preheat the oven to 350°F, and lightly grease a 9x13-inch baking dish.
Heat a medium skillet over low-medium heat. Melt 1 tablespoon of butter then add the onions and mushrooms.
1 medium onion, 4 ounces mushrooms
Cook for 5 to 7 minutes until the onions and mushrooms are tender. Add the garlic and cook for an additional 30 seconds. Remove the vegetables to a waiting bowl and set aside.
2 garlic cloves
Melt the remaining 3 tablespoons of butter in the pan. Then sprinkle in the flour. Whisk to combine and cook for 2 to 3 minutes.
¼ cup all-purpose flour
Slowly pour in the milk, heavy cream, and thyme. Whisk until a creamy sauce forms then add the sour cream, salt and pepper. Remove from heat.
1 cup whole milk, ½ cup heavy cream, ½ teaspoon dried thyme, 2 tablespoons sour cream, Salt and pepper
Bring a large pot of salted water to boil, and cook the green beans for 4 to 5 minutes. They should be tender but still have a crispy bite. Drain the green beans and immediately place them in a bowl of ice water to stop them from cooking.
1 pound fresh green beans
In a large bowl, combine the green beans, onions, mushrooms, and sauce. Transfer the mixture to the prepared baking dish.
Bake uncovered for 20 minutes. Remove from the oven and top with shredded cheese and French fried onions and bake for an additional 10 minutes.
1 cup Gruyere cheese, 6 ounces French fried onions
Serve warm! See post for tips and storage options.