Preheat the oven to 325 degrees F (165 degrees C). Combine pork and beans, bacon, onion, green bell pepper, ketchup, and brown sugar in a 9x13-inch baking dish. Cover with aluminum foil. Bake in the preheated oven for 2 hours, stirring every 30 minutes. Remove aluminum foil and cook 1 hour more, stirring every 15 minutes, until beans are thick and caramelized.