For the Topping: Pulse bread, butter, salt and pepper in food processor until mixture resembles coarse crumbs, about ten 1-second pulses. Transfer to a large bowl and toss with onions; set aside.
For the Beans and Sauce: Adjust oven rack to middle position and heat oven to 425 degrees F. Fill a large bowl with ice water. Bring 4 quarts of water to a boil in a large pot or Dutch oven. Add 2 tablespoons salt and beans. Cook beans until bright green and crisp-tender, about 6 minutes. Drain beans in colander and plunge immediately into ice water to stop cooking. Spread beans on paper towel-lined baking sheet to drain.
Add butter to now-empty pot and melt over medium-high heat until foaming subsides. Add mushrooms, garlic, 3/4 teaspoon salt, and 1/8 teaspoon pepper; cook until mushrooms release moisture and liquid evaporates, about 6 minutes. Add flour and cook for 1 minute, stirring constantly. Stir in broth and bring to simmer, stirring constantly. Add cream, reduce heat to medium, and simmer until sauce is thickened and reduced to 3 1/2 cups, about 12 minutes. Season with salt and pepper to taste.
Add green beans to sauce and stir until evenly coated. Arrange in an even layer in 3-quart (or 9×13-inch) baking dish. Sprinkle with topping and bake until top is golden brown and sauce is bubbling around edges, about 15 minutes. Serve immediately.
Note 1: You can prep this ahead of time. Store the bread-crumb topping in an airtight container in the refrigerator and combine with the onions just before cooking. Combine the beans and cooled sauce in a baking dish, cover with plastic wrap, and refrigerate for up to 24 hours. To serve, remove the plastic wrap and heat the casserole in a 425-degree oven for 10 minutes, then add the topping and bake as directed.
Note 2: This recipe can be halved and baked in a 2-quart (or 8-inch square) baking dish. If making a half batch, reduce the cooking time of the sauce in Step 3 to about 6 minutes (1 3/4 cups) and the baking time in Step 4 to 10 minutes.
Note 3: If you want to go 100% homemade and eliminate the canned fried onions, you can make your own caramelized onions. Thinly slice 2 sweet onions and saute in 2 tablespoons of unsalted butter over medium-high heat for about 10 minutes. Reduce heat to medium-low and sprinkle with salt and cook, stirring occasionally, for about 30 minutes, or until the onions are golden, caramelized and soft. Set aside to cool before combining with remainder of crumb topping. Proceed with the recipe as directed.