Preheat the oven to 375 degrees. Prepare an 8x8 dish for baking with a light coating of cooking spray. Set aside.
Bring a large pot of water to a boil. Add the green beans and cook for about 7 minutes. Drain and set aside.
While the green beans are boiling, heat oil in a large frying pan over medium heat. Add the onions, garlic and mushrooms and cook until tender.
Add the salt, pepper and flour and stir until the vegetables are coated. Cook for two more minutes.
Slowly pour in the vegetable broth and milk, whisking constantly to incorporate. Cook for about 10 minutes or until the liquid is thick and bubbly. You can add additional salt and pepper if desired at this time.
Once the mixture is thick and bubbly, stir in 1 cup of the crispy fried onions and the cooked green beans.
Pour the green beans and sauce mixture into the prepared baking dish and top with the remaining 1 cup of crispy onions.
Bake in preheated oven for 15 minutes or until the casserole is lightly browned and bubbling on top.