Preheat your oven to 375°F (190°C).
In a large oven-safe pot or Dutch oven, heat olive oil over medium heat.
Sauté the onion until soft and translucent, about 5 minutes. Add garlic and cook for another minute.
Stir in carrots, celery, thyme, paprika, chili flakes (if using), and tomato paste. Cook for 2–3 minutes.
Add lentils, vegetable broth, bay leaves, salt, and pepper. Bring to a boil, then reduce heat and simmer for 20 minutes.
Remove from heat and discard bay leaves. Arrange the sliced potatoes over the lentil mixture in overlapping layers.
Brush the top with olive oil and season with additional salt and pepper.
Cover with lid or foil and bake for 30 minutes. Uncover and bake for another 20 minutes until potatoes are golden.
Garnish with fresh thyme and serve hot.