Heat the oven and water. Heat the oven to 375°F and bring a large pot of water to a boil.
Blanch the green beans. Boil the beans 3 minutes, until bright green and just tender. Drain, put the beans in ice water for 2 minutes, then drain well and pat dry.
Coat the shallots. Toss the shallot rings with ¼ cup flour and ¼ teaspoon salt until every ring is coated.
Fry the shallots. Heat 1 cup oil in a medium saucepan to 325°F. Fry the shallots in 2 batches, 3 to 4 minutes each, until pale golden. Drain on a paper towel-lined plate.
Brown the mushrooms. Warm 3 tablespoons olive oil in a large deep skillet over medium-high heat. Cook the mushrooms 8 minutes, until the liquid is gone and they are browned, then stir in the garlic for 30 seconds.
Make the sauce base. Sprinkle in ¼ cup flour and stir 1 minute. Whisk in 1 cup vegetable broth and 1 cup soy milk a splash at a time.
Simmer the sauce. Add the soy sauce, thyme, nutmeg, ½ teaspoon salt and pepper. Simmer 4 to 5 minutes, stirring, until the sauce coats the back of a spoon.
Combine and bake. Fold the beans into the sauce, spoon into a 9x13-inch baking dish and level the top. Bake uncovered 20 minutes, until the sauce bubbles at the edges.
Top and rest. Scatter half the shallots on top and bake 5 minutes more, until the center reads 165°F. Rest 10 minutes, scatter the remaining shallots and serve.