Preheat the oven to 425 degrees.
Toss the green beans with the olive oil and roast for 20-25 minutes.
Lower the heat to 350 degrees.
Add the second tablespoon of olive oil to the pan and cook the red onions until caramelized on medium high heat, about 5-7 minutes.
Remove the onions and add in the mushrooms cooking them until they're caramelized, 5-7 minutes.
Add in the flour, salt and pepper and half the red onions whisking well, cooking for 30 seconds.
Add in the milk and whisk well, letting it cook for 3-4 minutes or until thick enough to coat a spoon.
Toss the green beans with the sauce and cheese and place into a baking pan.
Top with the remaining red green beans and bake for an additional 10 minutes, or until the cheese is melted and bubbly.