Cover potatoes with water and bring to a boil. Simmer until tender. Drain if necessary and mash.
Meanwhile combine lentils and bay leaf. Cover with water and bring to a boil. Simmer for 15 minutes, or until lentils are tender. Drain and remove bay leaf.
Meanwhile saute onions in butter until softened, 3-5 minutes. Add mushrooms and cook until the mushrooms liquid has evaporated. Stir in garlic, thyme and black pepper. Saute 1 more minute. Stir in miso, vegetable broth, 1 oz of shredded gruyere, and cooked drained lentils, stirring to combine.
Transfer the mushroom mixture to an oven safe dish (or keep it in your cast iron skillet).
Mix milk, salt and egg into the mashed potatoes. Spoon the mashed potatoes over the mushroom mixture, spreading it out evenly. Top with remaining cheese and bake in the preheated oven for 35 minutes, or until the cheese is melted and starting to brown.
Let the pie cool for at least 10 minutes before serving.
Recipe by Alison's Allspice at https://www.alisonsallspice.com/miso-mushroom-lentil-shepherds-pie/