Cut the bacon in 1/4 inch thin strips. Cook in a large skillet over medium heat, stirring occasionally until browned and crispy. Drain on paper towels.
Pour out the drippings into a measuring cup and reserve two tablespoons bacon grease. Do not wipe out the pan.
Add the sliced onions to the same large skillet and cook over medium low heat, stirring occasionally, until browned and caramelized, about 20 minutes. Add the garlic and cook for several more minutes, until lightly browned. Remove from heat and reserve.
Steam the green beans in a steamer over boiling water, until tender and bright green, about 5 to 6 minutes. Pour into a large bowl and allow to cool.
To make the sauce, heat the reserved bacon grease in a large heavy saucepan over medium heat and sprinkle in the flour. Cook, whisking, until the mixture just barely starts to brown. Add the broth and cook, whisking constantly, until mixture thickens. Add the cream, salt and pepper and cook, continuing to whisk constantly, until sauce thickens and coats the spoon.
Preheat the oven to 350 degrees and grease a 2 quart casserole dish.
In the large bowl holding the green beans, add the sauce, half the bacon, the caramelized onions and half of the Parmesan cheese.
Stir until all the ingredients are combined. Spoon into the prepared casserole dish, and sprinkle with the remaining Parmesan cheese and bacon.
Cover and cook in the oven until hot and bubbly, about 20 minutes. Cool on a wire rack for 5 minutes and serve.