Heat canola oil in a deep skillet to 325°F. Coat the shallots in flour and fry them until golden brown. Drain on paper towels and set aside for topping.
Melt butter in a large skillet and sauté diced shallot and mushrooms until tender. Stir in garlic and thyme for a fragrant base.
Add flour to the skillet and cook briefly, then pour in chicken stock, scraping up any bits from the pan. Simmer until slightly thickened.
Stir in the fresh green beans and cook until just tender. This keeps the beans crisp-tender and prevents mushiness.
Remove from heat and mix in 1 cup of cheddar cheese and heavy cream until smooth. Season with salt and pepper.
Top with remaining cheese, Panko, and crispy fried shallots. Bake at 350°F for 25–30 minutes until bubbly and golden brown.