Bring a pot of water to a boil, add green beans, and cook for 4-5 minutes. Remove from the boiling water, and plunge them into an ice water bath to stop the cooking. Drain and set aside. You can do this step in advance.
Heat a saucepan or skillet on medium-high, then fry the bacon until crispy, 5-7 minutes. Drain off the excess fat, then add onions and garlic, and continue cooking until the onions are wilted.
Toss in the mushrooms, sprinkle with a pinch of salt, and cook for 5-6 more minutes. Remove the mixture from the pan and set aside. Wipe the pan clean.
Add butter (or reserved bacon fat) to the skillet, and as soon as it melts, whisk in the flour. Whisk until the flour and butter are thoroughly combined, and continue cooking for about a minute to get rid of the raw flour taste.
Add the chicken broth, a little at a time, followed by the milk. Continue whisking to avoid lumps. Heat to bubbling, reduce the heat to medium, and simmer gently until it thickens into a creamy sauce (6-8 minutes).
Stir in the shredded cheese, then add the mushroom mixture back to the skillet, and stir to combine. Season with salt, pepper, and Creole seasoning.
Remove the pan from the heat, add the green beans and, if desired, half of the fried onions. Stir to combine. Adjust seasonings to taste.
Transfer the green bean mixture into a 9×13-inch baking dish, spread it out evenly, and then top it with the remaining fried onions.
Place in the oven and bake at 350℉ (180℃) for 25-30 minutes or until bubbly and golden brown.