Preheat the oven to 350 degrees F.
Melt the butter in a large oven-proof skillet over medium-high heat. Add the onions and mushrooms and cook, stirring occasionally, until the mushrooms are tender and browned, about 5-6 minutes.
Stir in the garlic, thyme, and flour. Cook, stirring often, until fragrant, about 1-2 minutes.
Pour in the white wine and stir, scraping any browned bits from the bottom of the pan. Allow the alcohol to cook off and slightly reduce, about 2-3 minutes.
Stir in the chicken stock, bring to a boil, reduce the heat, and simmer for about 5 minutes.
Carefully add in the green beans and cook until crisp-tender, about 6-8 minutes. Use a pair of tongs to gently mix the beans as they cook.
Remove the skillet from the heat. Stir in ½ cup of sharp white cheddar, ½ cup gruyere, and the heavy cream. Season with salt and pepper to taste.
Top the casserole with the remaining cheese and place it in the oven. Bake for 20 minutes.
While you wait for the casserole to cook, prepare the garlicky panko topping.
After 20 minutes, open up the oven and top the casserole with the garlicky panko crumbs. Close up the oven and allow the casserole to continue baking for an additional 10 minutes.
Allow to cool for about 10 minutes, then serve immediately.