For the topping: pulse the bread, softened butter, salt and pepper in a food processor until the mixture resembles coarse crumbs, about ten 1-second pulses. Transfer to a large bowl and toss with the onions; set aside.
For the beans: Adjust an oven rack to the middle position and heat the oven to 375 degrees. Bring 4 qt water to a boil in a large pot. Add 2 tbsp salt and the beans. Cook until bright green and slightly crunchy, 4 to 5 minutes. Drain the beans and plunge immediately into a large bowl filled with ice water to stop cooking. Spread the beans out on a paper towel-lined baking sheet to drain.
Meanwhile, cover the dried porcini mushrooms with 1/2 cup hot tap water in a small microwave-safe bowl; cover with plastic wrap, cut several steam vents with a paring knife, and microwave on high power for 30 seconds. Let stand until the mushrooms soften, about 5 minutes. Lift the mushrooms from the liquid with a fork and mince using a chef's knife (you should have about 2 tablespoons). Pour the liquid through a paper towel-lined sieve and reserve.
Melt the butter in a large nonstick skillet over medium-high heat until the foaming subsides, about 1 minute. Add the onion, button and cremini mushrooms and cook until the mushrooms release their moisture, about 2 minutes. Add the porcini mushrooms along with their strained soaking liquid, thyme, 1 tsp salt and pepper; cook until all the mushrooms are tender and the liquid has reduced to 2 tablespoons, about 5 minutes. Add the garlic and saute until aromatic, about 30 seconds. Add the flour and cook for about 1 minute. Stir in the broth and reduce the heat to medium. Stir in the cream and simmer gently until the sauce has the consistency of a dense soup, about 15 minutes.
Arrange the beans in a 3-quart gratin dish. Pour the mushroom mixture over the beans and mix to coat the beans evenly. Sprinkle with the breadcrumb mixture and bake until the top is golden brown and the sauce is bubbling around the edges, about 15 minutes. Serve immediately.