Preheat the oven to 200C / 392F and grease a medium sized casserole dish.
If using the onion and bacon topping, fry in a frying pan over medium-high heat until crispy. Set aside to drain on paper towel, leaving the bacon grease in the pan.
Meanwhile, steam the green beans in a microwave safe container until cooked to your liking. I like them still a bit crunchy, so this usually takes 5 - 6 minutes in the microwave. Place in your casserole dish.
In the same frying pan, add the mushrooms and butter and saute until lightly golden.
Add the chicken stock, cream, garlic, dijon mustard, salt and pepper and stir to thoroughly combine.
Simmer for 10 - 12 minutes until thickened slightly and taste for extra salt and pepper.
Add the xantham gum and continue simmering for 4 - 5 minutes until the sauce has thickened and coats the back of a spoon.
Pour the mushroom sauce over the beans and stir to combine.
Sprinkle the grated cheese over the casserole, then top with the crispy bacon and onions.
Bake in the oven for 15 - 20 minutes until the bacon and onion are a deep golden colour.
Serve immediately, but also reheats very well and is just as delicious for days to come!