01 - Preheat the oven to 375°F. Lightly grease a 2-quart baking dish with butter or cooking spray.
02 - Bring a large pot of salted water to a rolling boil. Add green beans and cook for 4–5 minutes until bright green and just tender. Drain immediately and transfer to an ice bath to stop cooking. Drain again and set aside.
03 - In a large skillet over medium heat, melt butter. Add chopped onions and sauté for 2–3 minutes until translucent. Add garlic and mushrooms; cook for 5–6 minutes until mushrooms are softened and browned.
04 - Stir flour into the vegetable mixture and cook for 1 minute to form a roux. Gradually whisk in milk and broth until smooth. Bring to a simmer and cook for 3–4 minutes, stirring frequently, until thickened. Season with salt, pepper, and nutmeg.
05 - Remove skillet from heat. Add blanched green beans to the sauce and fold gently until evenly coated.
06 - Transfer the mixture to the prepared baking dish. Sprinkle half of the crispy fried onions evenly over the top.
07 - Bake for 20 minutes until the sauce is bubbling around the edges.
08 - Remove from oven and sprinkle with remaining fried onions. Return to oven and bake for an additional 5 minutes until the topping is golden brown and crisp. Let cool slightly for 5–10 minutes before serving.