Prep the green beans: Bring a large pot of salted water to a boil. Add green beans and blanch for 4–5 minutes until slightly tender and bright green. Drain and place in ice water to stop the cooking. (Skip this step if using canned beans.)
Cook the bacon: In a large skillet, cook bacon until crispy. Remove and set aside. Keep about 2 tablespoons of bacon grease in the pan.
Make the roux: Add butter to the skillet with the bacon grease. Once melted, whisk in flour and cook for 1–2 minutes until slightly golden and fragrant.
Add liquids: Slowly whisk in milk, heavy cream, and cream of mushroom soup until smooth. Let it simmer for 3–5 minutes to thicken slightly.
Season: Stir in rosemary, thyme, salt, pepper, garlic powder, and onion powder. Add the Boursin, 1.5 cup of Gruyere, and Gouda cheeses. (Reserve remaining cheeses for topping) Mix until creamy and melted.
Combine: Fold in green beans, 1.5 cup fried onions and cooked bacon (reserve some fried onions and bacon for topping). Mix everything until evenly coated.
Assemble: Transfer the mixture to a greased 9x13 baking dish. Top with remaining fried onions, cheeses and remaining bacon bits.
Bake: Bake at 375°F for 25–30 minutes or until bubbly and golden brown on top.