Preheat oven to 350º F. Spray 9x13 baking dish with nonstick baking spray and set aside.
Bring about 2 quarts of water to a rolling boil. Add green beans to the boiling water and cook for 5-7 minutes. Remove from the boiling water and place in a bowl of ice water or immediately rinse with ice cold water. Set aside.
Meanwhile, melt butter and saute onions and mushrooms until tender, about 7-8 minutes. Add garlic and cook for an additional minute or so. Add green beans to sauted onions and mushrooms. Stir in cream of chicken soup and red pepper flakes, if using. Spread into prepared baking dish and bake for 20 minutes. Remove from the oven and sprinkle panko crumbs on top and return to the oven for the last 10 minutes.