Preheat oven to 375°F (190°C) and line a mini loaf pan with parchment paper.
In a small bowl, mix ground flaxseed with 3 tablespoons of water and let sit for 5 minutes to thicken into a flax egg.
In a non-stick skillet over medium heat, sauté the diced onion and half of the minced garlic with a splash of water until softened.
In a large mixing bowl, roughly mash the cooked lentils with a fork, leaving some texture.
Add the flax egg, sautéed onion mixture, chopped walnuts, pea protein powder, and nutritional yeast to the lentils.
Season with a pinch of salt, pepper, and dried thyme if desired, then mix until a thick dough forms.
Press the mixture firmly into the prepared loaf pan and bake for 25-30 minutes until the top is firm and edges are golden.
While the loaf bakes, steam the green beans until tender-crisp, about 5 minutes.
Toss the steamed green beans in a pan with the remaining minced garlic for 1-2 minutes until fragrant.
Allow the loaf to cool slightly before slicing and serving alongside the garlic green beans.