Heat olive oil in a large pan. Add onion and garlic, cook until soft.
Stir in mushrooms, carrots, and celery. Cook until mushrooms release liquid and start to brown.
Add thyme, rosemary, and tomato paste. Stir until fragrant.
Mix in cooked lentils and pour in vegetable broth. Simmer until thickened, about 10 minutes.
Boil potatoes and cauliflower together until tender, then drain.
Mash with butter and milk until smooth. Season with salt and pepper.
Spread lentil-mushroom filling into a baking dish, top with mash.
Bake at 375°F (190°C) for 25–30 minutes until golden.
Sprinkle with parsley before serving if desired.