Preheat oven to 350° F.
Season a large pot of water with sea salt. Bring to a boil, add green beans, and cook until bright green, about 6 minutes. Drain in a large colander and rinse under cold water. Let drain and set aside.
In a 10” cast iron skillet, melt 2 tablespoons butter over medium heat. Add onion and cook, stirring occasionally, until tender, about 5 minutes.
Add the sliced mushrooms and season with salt and pepper. Cook, stirring often, until mushrooms are golden, about 5-8 minutes.
Stir in garlic and cook until fragrant, 1 minute, then transfer mixture to green bean bowl.
In the same skillet over medium heat, melt the remaining 2 tablespoons of butter. Whisk in flour and cook until golden, about 2 minutes. Gradually whisk in milk a little at a time, using about 1 cup, until you get a gravy consistency. Bring to a simmer and cook until thickened, about 4 minutes. If the gravy looks too thick, add a little more of the reserved milk.
Remove from heat, add green bean mixture, and toss until evenly combined.
Bake until warmed through and bubbling, about 30 minutes.
Top with fried onions and bake for 5 minutes more.