01 - Preheat oven to 375°F. Grease a 2-quart baking dish with butter or cooking spray.
02 - Bring a pot of salted water to boil. Blanch fresh green beans for 4 minutes until just tender-crisp. Drain immediately and rinse under cold water to stop cooking and preserve bright green color.
03 - Melt butter in a large skillet over medium heat. Add chopped onion and sauté until softened, approximately 3 minutes. Add sliced mushrooms and cook until tender and liquid has evaporated, about 5 minutes. Stir in minced garlic and cook for 1 minute until fragrant.
04 - Sprinkle flour over the vegetable mixture, stirring constantly for 1 minute to cook out raw flour taste. Gradually whisk in milk and broth, ensuring no lumps form. Bring to a gentle simmer and cook for 2-3 minutes until sauce thickens enough to coat the back of a spoon.
05 - Remove skillet from heat. Stir in sour cream, salt, black pepper, and nutmeg until fully incorporated. The sour cream adds tanginess and prevents the sauce from becoming too heavy.
06 - Add prepared green beans to the sauce. Gently fold to coat evenly. Transfer the entire mixture to the prepared baking dish, spreading into an even layer.
07 - Bake uncovered for 20 minutes until the sauce is bubbly and the beans are heated through completely.
08 - Remove dish from oven and evenly distribute crispy fried onions across the top. Return to oven and bake for 10 minutes until onions are golden brown and the casserole is bubbling around the edges.
09 - Let the casserole rest for 5 minutes before serving. This allows the sauce to set slightly, making it easier to scoop and ensuring each portion holds its shape.