Preheat the oven to 350°F. Bring a large pot of lightly salted water to a boil.
Blanch the green beans for 1 to 2 minutes. Drain and immediately transfer to an ice-water bath to stop the cooking. Drain again and set aside.
Heat 1 tablespoon of butter in a large skillet over medium heat. Add the yellow onion and mushrooms and cook for about 5 minutes, until softened.
Stir in the garlic, ½ teaspoon kosher salt, and ground black pepper. Cook for an additional minute.
Add the remaining 2 tablespoons of butter. Once melted, whisk in the flour and cook for 1 minute.
Slowly add the vegetable broth, whisking constantly. Once the sauce has thickened to a gravy-like consistency and coats a spoon, reduce the heat.
Add the Worcestershire sauce and cream cheese. Stir until melted, then fold the green beans into the sauce.
Coat a 9×13-inch baking dish with cooking spray. Transfer the green bean mixture to the dish and top with the shredded cheddar cheese and fried onions.
Bake uncovered for 20 minutes. Rotate the dish, then bake for another 20 minutes, until the sauce is bubbling around the edges. If the fried onions are getting too brown when you rotate the dish, cover the top with foil.
Remove from the oven and let rest for 5 minutes before serving.