Preheat oven to 350°. Prepare an ice bath: In a large pot of boiling water, add green beans and cook until bright green, about 6 minutes. With a slotted spoon or tongs, quickly transfer green beans to ice bath to cool, then drain and transfer to a large bowl.
In a large ovenproof skillet over medium heat, melt 2 tablespoons butter. Add onion and cook, stirring occasionally, until tender, about 5 minutes. Add the corn, season with salt and pepper and stir cooking for 2-3 minutes. Add mushrooms and season with salt and pepper. Stir and cook until mushrooms are golden, about 5 minutes more. Stir in garlic and cook until fragrant, about 1 minute, then transfer mixture to green bean bowl.
Using the same skillet, melt remaining 4 tablespoons of butter. Whisk in flour and cook until golden, about 2 minutes. Gradually whisk in milk and bring to a simmer. Cook until thickened, about 4 minutes. Remove from heat, then add green bean/corn mixture and toss until even combined.
Cover with shredded Parmesan cheese.
Bake until warmed through and bubbling, about 20 minutes.