Heat the oven to 350°F (175°C). Lightly grease a 9 x 13-inch (3-quart) baking dish and set it aside.
Fry the onions first: toss the sliced onions with the flour, salt, pepper and garlic powder until every strand is coated, shaking off the excess. Heat the oil in a large, heavy skillet over medium-high heat until it shimmers and a test strand sizzles on contact (about 350°F (175°C) if you use a thermometer). Fry the onions in 3 batches, stirring once or twice, for 3 to 4 minutes per batch, until deep golden and crisp. Scoop them onto a paper towel-lined plate and sprinkle lightly with salt. Do not crowd the pan — crowded onions steam and go limp instead of crisping.
Blanch the beans: bring a large pot of water to a boil with the 1 tablespoon of salt. Add the beans and cook for 4 to 5 minutes, until bright green and crisp-tender. Drain and move them straight into a big bowl of ice water for 3 minutes to lock in the color, then drain very well and pat dry with a clean towel.
Start the sauce: melt the butter over medium-high heat, add the mushrooms in one layer and leave them alone for 3 minutes before stirring. Cook 6 to 7 minutes total, until their liquid has evaporated and they are well browned at the edges.
Add the diced onion and cook 3 minutes, until soft. Stir in the garlic and thyme and cook 30 seconds, just until fragrant.
Sprinkle the 3 tablespoons of flour over the vegetables and stir for 1 minute. Slowly pour in the broth, stirring constantly, then the cream. Simmer gently for 4 to 5 minutes, stirring often, until the sauce thickly coats the back of a spoon.
Stir in the Dijon, nutmeg, salt and pepper. Taste and adjust seasoning. Fold the dry blanched beans through the sauce until every bean is coated.
Tip everything into the prepared dish and spread it level. Bake, uncovered, at 350°F (175°C) for 20 minutes. Scatter the fried onions generously over the top and bake 5 minutes more, until the sauce bubbles at the edges and the onions are a shade deeper golden. Rest 10 minutes before serving.