Rinse the lentils and cook them in a large pot with vegetable broth over medium heat until tender and slightly thickened, about 25 minutes. Drain any excess liquid and set aside.
While the lentils cook, heat olive oil in a skillet over medium heat. Add chopped onion, carrots, and celery, cooking until they soften and develop a fragrant aroma, about 8-10 minutes.
Add minced garlic and dried thyme to the skillet, stirring for about 1 minute until the garlic is fragrant. Season with salt and pepper to taste.
Combine the cooked lentils with the sautéed vegetables in the skillet, stirring to incorporate all flavors. Adjust seasoning if needed. Let simmer gently for a few minutes, then remove from heat.
Preheat your oven to 375°F (190°C). Spread the lentil mixture evenly into a baking dish to create the filling layer.
Top the lentil filling with a layer of mashed roasted squash or sweet potato, smoothing it out with a spoon or spatula for an even surface.
Spoon the prepared mashed potatoes over the vegetable top, spreading gently to cover completely. For a golden finish, sprinkle shredded cheese evenly over the top.
Place the baking dish in the preheated oven and bake for about 20-25 minutes, until bubbling and golden on top.
Remove the dish from the oven and let it rest for 5 minutes. This makes it easier to serve and allows flavors to settle.
Slice and serve the hearty, layered shepherd's pie warm, enjoying the crispy top and tender filling with a spoon or fork.