Preheat your oven to 375°F (190°C). Line a 9x5-inch loaf pan with parchment paper, leaving overhang on the sides so you can lift it out later.
Mix 3 tablespoons ground flaxseed with 9 tablespoons water. Let it sit for 5 minutes. It'll get thick and gel-like.
If you're starting with dry lentils, cook 3/4 cup in 2 cups water for 20-25 minutes until tender, then drain.
Heat 2 tablespoons olive oil in a large skillet over medium heat. Add 1 diced onion and cook about 5 minutes until soft.
Add 3 minced garlic cloves and 8 oz chopped mushrooms. Cook 8-10 minutes until all the liquid cooks off. Don't rush this. Wet mushrooms will make your loaf fall apart.
Stir in 3 tablespoons tomato paste, 2 tablespoons soy sauce, 1 tablespoon balsamic vinegar, 1 teaspoon smoked paprika, 1 teaspoon dried thyme, 1/2 teaspoon dried sage, 1/2 teaspoon black pepper, and 1/2 teaspoon salt. Cook another minute or two, then take it off the heat.
Put 1 1/2 cups cooked lentils in a big bowl. Mash about half with a fork and leave some whole.
Add the mushroom mixture, 3/4 cup walnuts, 1 cup oats, 1/2 cup breadcrumbs, and the flax mixture. Stir it all together.
Press the mixture into your loaf pan. Really pack it down.
Whisk together 1/4 cup ketchup, 2 tablespoons maple syrup, 1 tablespoon balsamic vinegar, and 1 teaspoon Dijon mustard. Brush half over the loaf.
Bake 40 minutes. Add the rest of the glaze and bake another 15-20 minutes until it's firm and the top is sticky and shiny.
Let it sit in the pan 10 minutes before slicing. If you cut it too soon it'll crumble.