In a large bowl, add 2 of the sliced onions and the buttermilk and allow the onions to soak until the oil is heated.
In a large stockpot or saucepan, heat the vegetable oil to 375 degrees F. Make sure there is enough to submerge the onion slices completely.
On a shallow plate, add 3 cups of the flour, the salt, and the black pepper and whisk to combine.
In batches, dredge the marinated onion slices in the seasoned flour, making sure to coat them completely.
Add the dredged onion slices to the hot oil in batches to avoid overcrowding, and fry them, while turning them occasionally, until they are golden-brown all over, about 2-3 minutes.
Transfer the fried onions to a paper-towel-lined plate to drain and repeat until all of the onions are cooked. Set the fried onions aside.
Preheat the oven to 400 degrees F.
In a large bowl, prepare an ice bath.
In a pot of salted, boiling water, add the green beans and blanch them until they are bright green, about 5 minutes.
Transfer the blanched green beans to the ice bath to shock them and stop the cooking process.
In a large skillet over medium-low heat, add the olive oil and the butter and heat until the butter is melted.
Add the remaining diced onions, the salt, and the black pepper to the hot oil mixture and cook, while stirring, until the onions are softened, about 5 minutes.
Add the mushrooms to the onions and cook, while stirring, until the mushrooms are softened, about 5 minutes.
Add the garlic to the onion mixture and cook, while stirring, until fragrant, about 1 minute.
Add the remaining flour to the onion mixture and cook, while stirring, until a roux forms, about 2-3 minutes.
Slowly add the stock to the roux, while stirring, until combined.
Cook the stock mixture until it is thickened and simmering, about 5 minutes.
Add the heavy cream to the stock mixture and stir to combine.
Add the nutmeg and 1/2 cup of the Parmigiano-Reggiano cheese to the cream sauce and stir to combine.
Turn off the stovetop heat.
Drain the green beans from the ice bath and pat them dry with a paper towel.
Add the green beans to the cream sauce and toss to coat.
In a 9x13-inch baking dish, add the green bean mixture and spread it out evenly.
Top the green bean mixture with the extra Parmigiano-Reggiano and the crispy fried onions.
Bake until the sauce is bubbly and warmed through, about 20-25 minutes.
Serve immediately.