Bring a large pot of salted water to a boil. Add the green beans and cook until they just turn bright green, 2 to 3 minutes. (You don't want to cook the green beans through as they will cook in the oven also.) Strain and plunge the green beans immediately in a large bowl of ice water to stop the cooking process. When cool, drain and set out to dry on paper towels.
Set a 12-inch cast-iron skillet over medium-high heat. Add the butter and vegetable oil. Once the butter is melted and the pan is hot, add the mushrooms. Cook undisturbed so the mushrooms sear nicely, about 1 minute. Add the thyme and garlic and continue cooking the mushrooms to achieve some nice color. Season with the salt, pepper, cayenne and nutmeg. Cook 2 to 3 more minutes longer, dusting the mushrooms with some of the flour as they release moisture. Stir with a whisk to incorporate the flour (just like making a roux) and gradually add in the chicken stock. Bring to a simmer, then reduce the heat and add the sour cream and cream. Stir gently and cook over low heat until gravy thickens, 5 to 6 minutes. Add the blanched green beans to the pan and fold together so everything is mixed well. Spread out evenly in the pan. Sprinkle the green beans with the grated Parmesan and transfer to a roasting tray (to catch any spill-over). Bake until the casserole is bubbly and the top is melted and golden, 15 minutes.
Pour the vegetable oil into a deep skillet and heat to 350 degrees F. Pour the flour into a large mixing bowl and sprinkle generously with salt and pepper. Toss the shallot rounds in the seasoned flour, then place in a strainer and shake off any excess flour. Fry the shallots in the hot oil in small batches until golden brown, 3 to 5 minutes. Drain on paper towels and season with salt while still hot.
Top the green bean casserole with the fried shallots and serve.