Fill a large saucepan or a stockpot with salted water and bring it to the boil. Add the beans so that they are completely covered with water. Cook for 4-6 minutes or until softened but still crisp. Then drain the beans and run under cold water, place on a plate, and pat with a paper towel to remove the excess of water. Set aside.
Preheat the oven to 350F (175C).
Meanwhile, heat a non-stick skillet over a medium-high heat. Cook the bacon until deep golden-brown and crisp. When done, remove from the skillet onto a paper towel and set aside.
Add the butter onto the same skillet. When it has melted, add the onions and garlic and cook until translucent. Then, add the mushrooms, season with salt and pepper, and cook until golden brown.
Next, add the wine and cook until the liquids are reduced by half. Reduce the heat to medium, add the heavy cream and parmesan cheese, and cook for around 3-5 minutes, stirring occasionally until the sauce thickens. Remove from the heat.
Place the beans into a casserole dish and pour the sauce in. Mix everything and bake for 15-20 minutes or until bubbling and golden on top. Finally, sprinkle some extra parmesan cheese on top and then add bacon and bake for an additional 3-5 minutes.