Bring a large pot of water to a boil. Peel the potatoes, then dice them and place them in a bowl. Chop the rosemary very finely, making sure it is as small as possible; set aside an additional small amount (about 1/8 teaspoon) for the topping. Once the water is boiling, slide the potatoes into the water and boil 10 minutes until tender (test with a fork). Drain the potatoes and return them to the pot. Mash the potatoes, then add milk, butter, sour cream, 1/2 teaspoon black pepper, 1 teaspoon kosher salt, 1/2 cup shredded Parmesan cheese, and fresh rosemary. Set aside.
Meanwhile, place the French lentils into a large saucepan or pot with 6 cups water. Bring to a boil, then simmer 25 minutes until tender. Drain any excess liquid.
Mince 2 cups onion. Peel and dice the carrots. Dice the celery and mince the garlic.
Preheat oven to 400F.
In a very large skillet, heat the olive oil. Add the onion, carrots, and celery, and saute for 5 minutes until the onion is translucent. Add garlic and saute for 1 minute until translucent. Add the lentils, broth, miso dissolved in 1/2 cup water, balsamic vinegar, soy sauce, corn, peas, sage, 1/4 teaspoon kosher salt, and 1/2 teaspoon black pepper. Cook until most of the liquid cooks down but the filling is still moist, 10 to 12 minutes.
Place the lentil filling in a 9 x 13” pan, then using a spatula, spread the mashed potatoes over the lentils in a smooth layer. Top with a thin layer of Parmesan cheese and the reserved rosemary. Bake for 25 minutes. If desired, broil for a few minutes until browned on top. Serve warm from the oven.