Heat the olive oil in a large skillet over medium-high. Add the sliced mushrooms and 1 tablespoon of the butter to the skillet (working in batches if necessary). Sauté the mushrooms until softened and beginning to brown. Add the chopped rosemary and season with salt and pepper to taste.Remove the cooked mushrooms from the skillet along with any of their liquid and set aside.
Reduce the heat to medium and add a tablespoon of olive oil and the onion to the pan and cook until the onion is beginning to brown. Add the garlic and cook for another minute.
Next, add the flour and butter to the pan and cook for about 2 minutes, being careful to not let the flour burn. Add the wine and cook, stirring, until the wine is almost completely absorbed into the flour mixture, about 1 minute. Add the stock, 1 cup at a time, stirring frequently, until a gravy forms, about 3 minutes. Allow the gravy to simmer for another 5 minutes, adding more stock or water if it becomes too thick. Taste and adjust seasoning as needed.
Add the mushrooms back to the pan along with the lentils and stir well to combine. taste and adjust the seasoning.Transfer to a casserole dish.
Peel, cut, and boil the potatoes for 15 minutes or until tender.
Mash the potatoes with some of the boiling water and add butter, cream or milk, nutmeg, and salt, and pepper to taste. Feel free to add more, or less milk or cream depending on your taste preference for mashed potatoes.
Cut the cheese into roughly ½ cm cubes (or grate if you prefer) and stir into the mashed potatoes.
Spread the mashed potato mixture in an even layer over the mushroom base.
Mix together the melted butter, grated parmesan, and breadcrumbs and sprinkle over top of the mashed potatoes.
Place in the preheated oven and cook uncovered for 30-35 minutes or until the inside of the casserole is bubbling and the breadcrumbs are lightly browned on top.