Heat oven to 400 degrees. Coat a 9-by-13 baking dish with nonstick cooking spray. On a rimmed sheet pan lined with parchment paper, toss together green beans, mushrooms, sliced shallots, garlic and olive oil; season with salt and pepper to taste then spread evenly on the pan. Roast until the vegetables brown in spots and soften, about 30 minutes, tossing halfway through. (Alternatively, if you want the green beans extra soft, set them on an unlined sheet pan, add 3 tablespoons water, cover with aluminum foil, and cook until the vegetables are slightly firmer than you want in the end result, about 30 to 45 minutes.)
Meanwhile, in a large saucepan over medium-low heat, melt the butter, then add the flour. Cook for about 1 to 2 minutes, whisking constantly until it comes together and begins to turn golden in color.
Add heavy cream and whisk until it starts to thicken, 6 to 8 minutes. Add the Cajun seasoning, onion and garlic powders, chicken base, nutmeg and ½ teaspoon pepper. Whisk to combine, then add 1½ cups Parmesan until melted. Taste and adjust seasonings.
When the green beans are cooked, add them to the saucepan, and toss to coat until mixture is thoroughly heated. Transfer green bean mixture to the baking dish.
In a medium bowl, combine bread crumbs, fried shallots and the remaining ¼ cup Parmesan. Spread evenly over the top of the casserole.
Set the broiler to high, and broil until brown and bubbly (don’t walk away!), about 1 to 2 minutes. Serve hot.