01 - Preheat the 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 a boil. Add green beans and blanch for 4 minutes. Drain and transfer to an ice bath to stop cooking; drain again and set aside.
03 - In a large skillet over medium heat, melt the butter. Add chopped onion and cook for 2 minutes until slightly softened. Add garlic and mushrooms; sauté for 5-6 minutes until the mushrooms release their liquid and begin to brown.
04 - Sprinkle flour over the vegetables and stir well; cook for 1 minute. Gradually pour in vegetable broth, stirring constantly. Add milk and heavy cream; bring to a simmer. Cook, stirring, until the sauce thickens, about 4-5 minutes.
05 - Stir in salt, pepper, nutmeg, and soy sauce. Remove from heat.
06 - Add the blanched green beans and half of the crispy onions to the sauce; mix until evenly combined.
07 - Pour the mixture into the prepared baking dish. Top evenly with the remaining crispy onions.
08 - Bake uncovered for 20-25 minutes or until the casserole is bubbly and the onions are golden brown.
09 - Let the casserole rest for 5 minutes before serving to allow the sauce to set slightly.