While the tomatoes are roasting, you can work on the meatballs. Pour the olive oil in a large skillet and heat until shimmering. Add the onion and a pinch of salt. Saute over medium-low until just translucent. Stir in the basil, crushed red pepper flakes, and fennel seeds. Saute until fragrant.
Add the mushrooms to the skillet and saute until browned. Remove the veg with a slotted spoon and transfer to a bowl. Set aside.
Deglaze the skillet with the veggie stock and add the beans, lentils, thyme, bay leaves, and a generous sprinkling of salt. Bring the mixture up to a boil and reduce to a simmer. Let cook for 15-20 minutes or until the lentils are tender and most of the liquid has been absorbed.
Remove a cup-worth of the beans and lentils and set aside. Place the onion and mushrooms mixture in a large food processor. Add the remaining beans and lentils and blitz until smooth.
Place the puree in a large bowl and add the reserved beans and lentils back in. Add the breadcrumbs and the egg and, using a clean hand, mix until all the ingredients are well integrated. Using an ice cream scoop, scoop the mixture out onto a baking sheet lined with parchment paper. Refine the shape of each scoop, then refrigerate the meatballs until ready to bake.
At this point, the tomatoes should be ready to come out of the oven. Once you remove the tomatoes, increase the oven's temperature to 375°F. Once the oven is up, place the meatballs in the oven and bake for 15-20 minutes.