Stir 4 TBSP of flour with ¼ tsp salt and ¼ tsp pepper. Toss with the chopped onions. Heat 3 TBSP of oil in a large cast iron skillet over medium to high heat. Pan-fry the onions for 5-7 minutes, stirring every so often to keep them from sticking to the bottom of the pan. Once they have a nice golden brown layer then remove from pan and set aside.
Melt the butter in the same skillet. Stir in the ¼ cup of flour and stir to combine. Cook for 1 minute. Add the broth and simmer for 1-2 minutes. Lower the heat to medium-low and add the cream.
Cook until the mixture thickens, stirring often, approximately 6 to 8 minutes. Add in the remaining ingredients including the cooked onions and chopped bacon leaving the green beans for last. Stir to combine and cover. Cook on medium low for 15-20 minutes. Top with extra layer of crispy onions and the pecans.
Recipe by Kitchen Belleicious at https://kitchenbelleicious.com/2014/11/25/skillet-green-bean-casserole/