Place the panko in a large frying pan over medium heat and toast, stirring occasionally, until golden brown, about 10 minutes. Transfer to a small bowl and set aside. Wipe out the frying pan with paper towels, add 3 tablespoons of the butter, and melt over medium heat until foaming. Add the onion and cook, stirring occasionally, until just softened and starting to brown, about 15 minutes.
Meanwhile, bring a large pot of heavily salted water to a boil over high heat. Add the green beans and cook until they’re bright green and crisp tender, about 3 minutes. (They will not be fully cooked.) Drain in a colander and rinse under cold water until the beans are cooled, then set aside. Reserve the large pot.
When the onions are ready, remove the frying pan from the heat. Remove 1/4 cup of the onions and set aside. Add the toasted panko to the pan with the remaining onions, season with salt and pepper, and stir to combine. Return the panko-onion mixture to the small bowl and set aside.
Wipe out the frying pan with paper towels, add the remaining 6 tablespoons of butter, and melt over high heat until foaming. Add the mushrooms and cook, stirring occasionally, until browned and the liquid from the mushrooms is almost all evaporated, about 5 to 6 minutes.
Reduce the heat to medium and add the reserved 1/4 cup of onions to the pan. Sprinkle with the flour, season with salt and pepper, and stir to coat the vegetables. Cook, stirring frequently, until the raw taste of the flour is cooked off, about 1 minute. Gradually whisk in the milk, add the measured salt, and bring to a simmer. Continue simmering, stirring often, until the mushroom mixture has thickened slightly, about 1 to 2 minutes more.
Transfer the mushroom mixture to the reserved large pot, add the reserved green beans, and stir to combine. Taste and season with salt and pepper as needed. Transfer to a 13-by-9-inch baking dish and bake for 10 minutes. Remove the casserole from the oven, evenly sprinkle the reserved panko-onion mixture across the top, and continue baking until the casserole’s bubbling around the edges and heated through, about 10 to 15 minutes more. Place the pan on a wire rack and let cool 10 minutes before serving.
That pretty much all there is to me.