2 lb. green beans
2 Tbsp. olive oil, divided
1 lb. crimini mushrooms, sliced, and divided
6 Tbsp. unsalted butter, divided
4 large sprigs of thyme
2 Tbsp. all-purpose flour
1¼ cups whole milk
1 cup heavy cream
4 garlic cloves, finely grated
½ cup grated Parmesan
Freshly ground black pepper
¾ cup French's fried onions
Preheat oven to 375°. Working in batches, cook green beans in a large pot of boiling salted water until bright green and halfway to tenderness, about 3 minutes per batch. Drain and let cool; trim stem ends.
Heat 1 Tbsp. oil in a large skillet over medium-high. Cook half of the mushrooms, without stirring, until golden brown underneath, about 2 minutes. Toss and continue to cook, tossing occasionally, until browned on both sides, about 3 minutes more. Add 2 Tbsp. butter and 2 thyme sprigs to pan. Cook, tossing occasionally, until butter browns and mushrooms are dark brown and very tender, about 4 minutes longer. Season with salt and transfer to a plate. Repeat with 2 Tbsp. butter, salt, remaining oil, mushrooms, and thyme.
Melt remaining 2 Tbsp. butter in a large saucepan over medium-low. Whisk in flour and cook, whisking occasionally, until roux is golden brown and smells mildly nutty, for about 4 minutes. Whisk in milk and cream. Increase heat and bring to a simmer, whisking often, and cook until béchamel sauce is thick and bubbling, for about 5 minutes. Remove from heat and whisk in garlic and Parmesan; season with salt and pepper.
Arrange green beans and mushrooms in a 2-qt. baking dish. Pour sauce over (it may not look like enough, but it will get saucier as it bakes). Cover tightly with foil and bake until sauce is bubbling, 25–30 minutes. Uncover and continue to bake until casserole is lightly browned on top and around the edges, 15–20 minutes longer. Top with fried onions and continue to bake just until onions are slightly darker and fragrant, for about 3 minutes. Let sit for 10 minutes to set before serving.