Preheat the oven to 350 degrees F (175 degrees C).
Heat 2 tablespoons olive oil in a large saucepan or Dutch oven over medium heat. Add 6 shallots, mushrooms, and garlic. Cook and stir until garlic and shallots are soft, about 5 minutes. Add white wine and salt. Let simmer until flavors start to meld, 2 to 4 minutes. Add chicken broth and coconut milk; stir to combine. Add green beans. Bring to a boil.
Mix water and cornstarch together in a bowl; pour mixture into the saucepan. Cook and stir until thickened, 3 to 5 minutes. Season with salt and pepper. Pour mixture into a 9x13-inch baking dish.
Bake until mostly set, 35 to 40 minutes.
Toss the remaining 6 shallots in a bowl with gluten-free flour to coat.
Heat 1/4 cup olive oil in a skillet over medium heat. Add the coated shallots; cook and stir until golden, 4 to 5 minutes. Drain fried shallots on a paper towel. Sprinkle on top of the casserole.
Set oven rack about 6 inches from the heat source and preheat the oven's broiler. Return casserole to the oven; broil until shallots are crispy, 3 to 5 minutes.