Preheat the oven to 375°F. Spray an 11x7-inch baking dish with cooking spray and set aside.
Bring a large pot of water to a boil. Add the green beans and cook for 5 minutes.
Drain the green beans and immediately place them into a large bowl of ice water to stop the cooking process.
Drain the green beans again. Place them on a paper towel-lined sheet tray while you prepare the sauce.
In a large skillet over medium heat, melt the butter. Add the shallots to the skillet and cook until softened, 5 minutes. Add the thyme, salt, and pepper, stir it into the shallots.
Add the flour and whisk to combine, cook for 1 minute.
Slowly stream in the chicken stock while whisking constantly to avoid lumps. Do the same with the heavy cream.
Bring the mixture to a simmer and simmer for 8-10 minutes until thickened to a gravy consistency, whisking occasionally.
Add the drained green beans and toss to coat in the sauce.
Add the mixture to the prepared baking dish.
Top with the crispy fried onions and bake uncovered for 15-20 minutes until bubbly along the edges and the onions are browned on top. Serve immediately.
Notes
Please refer to my FAQ’s (Frequently Asked Questions) and ingredient list above for other substitutions or for the answers to the most common questions.