If using canned beans, drain them and move on to #2. Otherwise, soak dry beans overnight, or at least 8 hours, making sure water covers the beans by 3". Drain and rinse the beans. In a medium saucepan, add beans and enough fresh water to cover beans by 3". Add a pinch of salt and bring to a boil. Turn heat to medium-low and simmer for about 30-60 minutes. Start checking the beans at around 30 minutes. The beans are done when they are tender. (How long it takes for the beans to cook depends on the age and type of the beans used). Drain and set aside.
Preheat oven to 350F (177C).
In a large roasting pan, add the onion, carrots, garlic, chili flakes, cumin, paprika, salt and coconut or olive oil. Stir. Roast for 20 minutes, stirring after 5 minutes to evenly distribute the coconut or olive oil.
To the onion mixture, add the cooked beans, fire-roasted tomatoes, and BBQ sauce. Gently stir.
Bake, uncovered, at 350F for 45 minutes. Allow to rest for 5 minutes before sharing.
Store leftovers in a covered container for up to two days or freeze for up to two weeks. When reheating, add additional BBQ sauce or water to thin the beans as they tend to thicken.