Preheat the oven to 375°F and grease a 9x13 baking dish.
Bring a large pot of water and the salt to a boil. Add the green beans and cook until bright green and crisp-tender, 4 to 5 minutes. Drain and transfer to a bowl of ice water to stop the cooking, then drain again and pat dry. You're just blanching them at this step.
Melt the butter in a large skillet over medium-high heat. Add the mushrooms and cook, stirring occasionally, until their liquid evaporates and they are deeply browned, 8 to 10 minutes.
Add the shallot, garlic, and thyme and cook until fragrant, about 1 minute. Sprinkle in the flour and stir constantly for 1 minute.
Slowly whisk in the chicken broth, then the cream. Simmer, stirring often, until the sauce is thick enough to coat a spoon, 3 to 4 minutes. Remove from the heat and stir in the Parmesan, salt, and pepper.
Fold the green beans and half of the fried onions into the sauce, then spread in the prepared baking dish.
Bake uncovered until bubbling around the edges, about 20 minutes. Top with the remaining fried onions and bake until golden, about 5 minutes more. Let rest 5 minutes before serving.