01 - Preheat oven to 375°F. Lightly grease a 9x13-inch baking dish with butter or cooking spray.
02 - Bring a large pot of salted water to boil. Add green beans and blanch for 4 minutes. Drain immediately and transfer to ice bath to stop cooking. Drain again and set aside.
03 - Melt butter in large skillet over medium heat. Add chopped onion and cook 2 minutes until softened. Add garlic and mushrooms; sauté 5-6 minutes until mushrooms release liquid and begin to brown.
04 - Sprinkle flour over vegetables and stir well; cook 1 minute. Gradually pour in vegetable broth while stirring constantly. Add milk and heavy cream; bring to simmer.
05 - Cook sauce, stirring constantly, until thickened (4-5 minutes). Stir in salt, pepper, nutmeg, and soy sauce if using. Remove from heat.
06 - Add blanched green beans and half the crispy onions to sauce. Mix until evenly coated.
07 - Pour mixture into prepared baking dish. Spread evenly and top with remaining crispy onions.
08 - Bake uncovered for 20-25 minutes until sauce is bubbly and onions are golden brown and crispy.
09 - Let casserole rest for 5 minutes before serving to allow sauce to set slightly.