Preheat the oven to 400 degrees with the rack in the middle.
Bring a large pot of water and 2 tablespoons salt to a boil in a large saucepan or Dutch oven. Meanwhile, prepare an ice bath in a large bowl. Add the green beans to the boiling water and cook until crisp-tender, about 5 minutes. Drain in a colander and immediately transfer to the ice bath until completely cool, then drain.
In a 12-inch cast-iron skillet over medium-high heat, melt the butter. Add the mushrooms, 1 teaspoon salt and the pepper and cook, stirring occasionally, until the mushrooms begin to give up some of their liquid, 4 to 5 minutes. Add the garlic and continue to cook, stirring, for an additional 1 to 2 minutes. Sprinkle the flour over the mixture and stir to combine. Cook, stirring, for 1 minute. Add the broth and simmer for 1 minute. Decrease the heat to medium and add the half-and-half. Cook until the mixture thickens, stirring occasionally, 6 to 8 minutes. Reduce the heat as needed to prevent the mixture from scorching or bubbling too vigorously.
Remove from the heat and stir in 1/3 cup onions and the green beans. Top with the remaining onions. Transfer the skillet to the oven and bake for about 15 minutes, until the sauce is bubbling and the onions are crisp and dark golden brown, and serve.
Nutrition information per each of 6 servings:
Calories220Fat14 gSodium360 mg