Make sure a rack is placed in the bottom of the oven. Preheat to 350 F. Get a 9x13 baking dish out and set aside. If you're using fresh green beans, you'll need to parboil them before using. If you're using frozen green beans, rinse them off in a colander and set aside to drain.
In a medium saute pan, cook the bacon. Reserve the grease to cook the shallots in. Transfer the bacon to a paper towel-lined plate. Chop the shallots into circles and press the garlic while the bacon is cooking.
Pour 1 cup of milk and 1 cup of heavy cream into a large, glass measuring cup and set aside. In a large skillet over medium heat, melt 2 tablespoons of butter. Once melted, add 2 tablespoons of flour and stir to combine. The flour/butter mixture will be light brown once mixed together. Stir frequently to be sure it does not stick to the pan.
Pour the milk mixture into the pan with the flour/butter mixture in small additions, stirring together completely before adding more in. It will look lumpy but will smooth out as you keep stirring and cooking it.
Once the sauce has smoothed out, add the 1/2 cup Parmesan flakes and stir until combined. Add in the pressed garlic and stir to combine.
Add the green beans into a large mixing bowl. Add the sauce and crumbled bacon and mix to combine everything. Pour this mixture into the 9x13 casserole dish. Cover with aluminum foil and set on the middle rack in the oven. Bake for 20 minutes.
Reserve some fresh shallots, about 2 tablespoons, and saute the rest of the shallots in the bacon grease until soft and translucent. Some of the smaller pieces will get a little crunchy, this is fine. Remove shallots onto a paper towel-lined plate to drain the grease.
Combine the shallots with 1/2 cup of panko breadcrumbs. After 20 minutes, remove the casserole from the oven and remove the aluminum foil. Sprinkle the shallot mixture on top of the casserole and return to the oven. Bake for another 10 minutes.
The casserole should be nice and bubbly at this point. Remove from oven and let rest for 10 minutes. This is meant to be a side dish, but honestly, I could eat this all by itself.