Preheat oven to 350°F (175°C).
Make the crispy shallots: line a plate with paper towels. Place 8 tablespoons of the olive oil in a medium skillet over medium-low heat. Add the shallots and cook, stirring occasionally, until golden brown, about 20 to 25 minutes. If they’re browning too quickly, lower the heat. With a slotted spoon, transfer the shallots to the paper towel-lined plate to drain and crisp up as they cool. Sprinkle lightly with salt.
Meanwhile, make the casserole: fill a medium bowl filled 3/4 full with ice water. Fill a medium saucepot with water and 2 tablespoons salt. Bring to a boil over high heat. Add the green beans and cook until just fork-tender, about 8 minutes. Immediately drain and plunge the green beans into the ice water to stop the cooking. Remove the green beans from the water to a clean kitchen towel, then blot them dry. Set aside.
Heat a large skillet with the remaining 2 tablespoons of the olive oil over medium-high heat. Add the mushrooms and cook, stirring occasionally, until the they’re golden brown, 8 to 10 minutes. Add the garlic powder, onion powder, and beef broth and bring to a boil, scraping up any bits from the bottom of the skillet with a spoon. Reduce to a simmer and stir for 1 minute.
Stir in the cream cheese until it’s incorporated and smooth. Add 1-1/2 teaspoons salt and 1/2 teaspoon pepper and cook, stirring constantly, until the mixture begins to thicken, 2 to 3 minutes. Reduce the heat to medium and cook, stirring occasionally, until the mixture is thick, like condensed soup, about 3 to 4 minutes. Add the grated cheese, Worcestershire sauce, and the drained green beans and toss well to combine. Transfer the mixture to an 8-inch baking pan, cover tightly with foil, and cook for 20 minutes.
Remove the foil and cook until bubbly and slightly browning on top, 5 to 10 minutes more.
To serve, let the casserole rest for 5 minutes, sprinkle the top with the crispy shallots and serve.