First of all, you have to preheat the oven to 350 degrees. After that, you have to trim the fennel bulbs and get rid of the tougher outer layer. You have to cut the bulbs into quarters. Then, put the pieces in a saucepan with all the vegetables. Place the saucepan on the stove and keep the heat low. Cook all the ingredients for around 5 to 6 minutes.
Take the funnel out from the pan and put it a platter. Reduce half of the vegetables and boil the remaining. Then, remove the pan them from the stove and place them aside to cool down.
Now, take another pan and melt some butter in it. When the butter starts to melt, add the bacon and shallots in it. Cook them for around 3 to 4 minutes. Then, add the flour, cream, Madeira wine and vegetable stock and cook for 3 to 4 minutes more while stirring continuously. Add salt and black pepper according to your taste on the ingredients.
Boil the salted water in the pan and then add the olive oil and pasta. Cook all the ingredients for around eleven minutes (until the pasta become soft).
Now, drain the pasta and place them in the baking dish. Pour the fennel and sauce on the pasta which is in the baking dish.
Place the baking dish in the oven and bake it for around 20 minutes. Take it out and let it cool down for around 5 minutes before serving.