Use an immersion blender or regular blender to blend the tomatoes. Set aside.
Heat a small Dutch oven or large skillet over medium-low heat. Add the onions, carrots, and celery. Let the mirepoix cook for 15 minutes until the veggies are very soft. Add water a tablespoon at a time if they start to stick.
Add the garlic and 1 teaspoon of chili flakes and cook for about 30 seconds. Then add 2 tablespoons of tomato paste and cook for about a minute before adding the can of tomatoes, 1 teaspoon oregano, 1 teaspoon smoked paprika, and 3 bay leaves.
Lower the heat and let the sauce simmer for 10 minutes until it thickens.
While the sauce cooks, drain the beans and reserve the liquid.
Preheat the oven to 350 F (175 C).
Transfer the sauce to an oven-proof casserole or baking dish. If using a Dutch oven or other stove to oven pan, skip this step.
Once the sauce is ready, add ⅓ cup fresh parsley and 2 tablespoons dill and taste for seasoning.
Add the beans and mix well. Then add 1-2 cups of the bean liquid, enough to cover the beans. Keep the reserved liquid in case you need to add more later.
Cover and bake the beans for 1 to 1 ½ hours. Check the beans occasionally, adding more liquid if the mixture seems too dry. The liquid should mostly evaporate, and the beans should be tender but not too dry.
For the last 10 minutes, the oven temperature can be turned up to 400 F (200 C) to reduce the sauce further. This will also crisp up the top nicely.
Garnish the final dish with more finely chopped parsley or dill if desired.