Place the oven rack in the middle and preheat your oven to 375°F.
In a big pot, bring water to a boil and add a sprinkle of kosher salt. Cook the green beans for about 3 minutes until they turn a bright green and are slightly tender. Drain and let them cool before trimming the ends.
In a large skillet, heat 1 Tbsp. of olive oil over medium-high heat. Add half of the sliced mushrooms and let them cook without stirring for about 2 minutes until golden brown on one side. Toss them and cook for an additional 3 minutes until both sides are nicely browned. Stir in 2 Tbsp. of butter and 2 sprigs of thyme, cooking until the butter is browned and the mushrooms are tender, around 4 minutes. Season with salt and transfer to a plate. Repeat with the rest of the mushrooms, butter, thyme, and oil.
In a separate saucepan over medium-low heat, melt the remaining 2 Tbsp. of butter. Whisk in the flour, stirring occasionally until it’s golden and smells nutty, about 4 minutes. Gradually whisk in the milk and cream, raising the heat to bring it to a simmer. Cook while whisking until the sauce thickens and bubbles, about 5 minutes. Remove from heat and mix in the garlic, Parmesan, and season with salt and pepper.
In a 2-quart baking dish, combine the green beans and mushrooms. Pour the creamy sauce over them. Cover with foil and bake for 25-30 minutes until bubbling.
Uncover and bake for another 15-20 minutes until the top is lightly browned. Sprinkle the fried onions on top and bake for an additional 3 minutes until they are fragrant. Let it sit for about 10 minutes before serving.