Prep your oven and dish: Heat the oven to 375°F (190°C).
Grease a 9x13-inch baking dish with butter or cooking spray.
Blanch the green beans: Bring a large pot of salted water to a boil. Add the green beans and cook for 3–4 minutes until crisp-tender and bright green. Drain and immediately plunge into a bowl of ice water to stop the cooking.
Drain well and set aside.
Sauté the aromatics: In a large skillet, heat the olive oil and 2 tablespoons butter over medium heat. Add the onion and cook until softened, about 3–4 minutes. Stir in the garlic and cook 30 seconds until fragrant.
Cook the mushrooms: Add the sliced mushrooms and a pinch of salt.
Cook, stirring occasionally, until they release their moisture and turn golden, 7–9 minutes. Don’t rush this step—the browning builds flavor.
Make the roux: Add the remaining 2 tablespoons butter to the pan. Sprinkle in the flour and cook, stirring constantly, for 1 minute to remove the raw flour taste.
Build the sauce: Slowly whisk in the broth, then the cream.
Add thyme, black pepper, and 1 teaspoon salt to start. Stir in soy sauce or Worcestershire. Simmer 3–4 minutes, stirring, until the sauce thickens to a gravy-like consistency.
If using Parmesan, stir it in now. Taste and adjust seasoning. A small squeeze of lemon can brighten the flavor.
Combine: Add the drained green beans to the sauce and fold gently to coat.
Assemble: Transfer the mixture to the prepared baking dish.
Top with 1 cup of crispy fried onions.
Bake: Place in the oven and bake for 15–20 minutes until bubbling around the edges.
Finish the topping: Sprinkle the remaining fried onions over the top and bake 5–7 more minutes until golden and crisp. Let rest 5–10 minutes before serving to set the sauce.