Preheat the oven to 200°C.
Heat the olive oil in a large frying pan over medium heat. Add in the onion and garlic and fry for a few minutes until the onion is soft.
Add the carrots, celery, and red pepper, and stir well. Cook for 5-10 minutes, stirring occasionally, until the vegetables start to soften.
Add the thyme, rosemary, and tomato puree, and stir well to combine.
Add the lentils and chopped tomatoes, and stir well to combine. Bring the mixture to a simmer and cook for 10-15 minutes until the sauce has thickened.
Meanwhile, boil the sweet potato and parsnips until soft. Mash them with the butter and milk to form a smooth mash.
Transfer the lentil mixture to a large baking dish, and spread the mashed sweet potato and parsnips on top.
Bake for 20-25 minutes until the top is golden brown and crispy.