Preheat your oven to 325°F (163°C).
If you're using bacon, cook it in a skillet over medium heat until it's slightly crispy. Remove the bacon from the skillet, blot it with paper towels to remove excess grease, and chop it into small pieces. Set aside.
In a large oven-proof Dutch oven or casserole dish, combine the drained and rinsed navy beans and finely chopped onion.
In a separate bowl, whisk together the molasses, brown sugar, ketchup, mustard, apple cider vinegar, salt, black pepper, and smoked paprika (if using).
Pour the molasses mixture over the beans and onions. If you're using bacon, add the chopped bacon pieces to the mixture as well.
Stir everything together until the beans are coated evenly with the sauce.
Cover the Dutch oven or casserole dish with a lid or aluminum foil.
Place the covered dish in the preheated oven and bake for 1.5 to 2 hours, or until the beans are tender and the sauce has thickened, stirring occasionally.
If the sauce thickens too much or the beans become too dry during baking, you can add a little water or gluten-free broth to reach your desired consistency.
Once the baked beans are done, remove them from the oven and let them cool for a few minutes before serving.