Heat the oven to 375°F (190°C) and butter a 9x13-inch baking dish. Bring a large pot of water to a rolling boil, add 1 tablespoon of kosher salt, and fill a large bowl with ice water. Drop 2 lb of trimmed green beans into the boiling water and cook for 3 to 4 minutes, until bright green and crisp-tender. Lift them into the ice bath, let them cool, then drain well and pat dry.
Pour 1/2 cup of vegetable oil into a small saucepan over medium heat. When the oil shimmers, add 3 thinly sliced shallots in a single layer and cook, stirring often, until golden brown and crisp, 4 to 6 minutes. Lift them out with a slotted spoon onto a paper-towel-lined plate and season with 1/4 teaspoon of kosher salt.
Melt 4 tablespoons of butter in a large skillet over medium-high heat. Add 12 oz of sliced cremini mushrooms and 1 finely diced medium yellow onion and cook without stirring for 3 minutes, then stir and cook 4 to 5 minutes more, until deeply golden and soft. Stir in 4 minced garlic cloves and 1 teaspoon of fresh thyme leaves and cook for 30 seconds.
Sprinkle 1/4 cup of flour over the mushrooms and stir for 1 minute. Pour in 1 1/2 cups of broth a little at a time, stirring and scraping the pan, then stir in 1 cup of heavy cream. Simmer gently for 3 to 4 minutes, stirring often, until thick enough to coat the back of a spoon. Stir in 1 teaspoon of soy sauce, 1/2 cup of grated Parmesan, 1 teaspoon of kosher salt and 1/2 teaspoon of black pepper.
Fold the drained green beans into the warm sauce and toss until coated. Transfer to the buttered 9x13-inch dish and spread into an even layer. Toss 1 1/2 cups of panko with 3 tablespoons of melted butter, 1/4 cup of grated Parmesan and 1/4 teaspoon of black pepper, and set the fried shallots and buttered panko aside.
Bake uncovered for 20 minutes, until the sauce bubbles around the edges. Scatter the fried shallots over the top, sprinkle the buttered panko evenly over them, and bake 5 to 10 minutes more, until the topping is deep golden and the sauce bubbles to the center. Tent loosely with foil if the top browns too fast. Rest for 5 minutes before serving.