01 - Preheat the oven to 375°F. Grease a 9x13-inch baking dish with butter or cooking spray.
02 - Bring a large pot of salted water to a boil. Add green beans and cook for 5 minutes until just tender. Drain and immediately transfer to a bowl of ice water to stop the cooking process. Drain again and set aside.
03 - In a large skillet over medium heat, melt the butter. Add chopped onion and cook for 3 minutes until softened. Add garlic and mushrooms; sauté for 5 to 6 minutes until mushrooms are golden and tender.
04 - Sprinkle flour over the vegetables and stir constantly for 1 minute to cook out the raw flour taste.
05 - Gradually whisk in milk, broth, and cream. Add salt, pepper, and nutmeg. Bring to a simmer and cook, stirring often, until sauce thickens and coats the back of a spoon, about 5 minutes.
06 - Add the blanched green beans to the skillet and stir to coat evenly with the creamy mushroom sauce.
07 - Transfer the mixture to the prepared baking dish. Top with crispy fried onions in an even layer.
08 - Bake uncovered for 20 minutes, or until the sauce is bubbly and the crispy onions are golden brown on top.
09 - Let the casserole rest for 5 minutes before serving to allow the sauce to set slightly for easier scooping.