Place the beans in a large bowl, cover with 2 inches of water and soak overnight.
Drain the beans. Heat the oil in a large Dutch oven over medium heat.
Add the onions and garlic and cook until tender, 5 minutes.
Stir in the soaked beans, ham shank, chicken broth, cumin, basil, salt, black pepper and cayenne. Bring to a boil, reduce to a simmer and cook, uncovered, until the beans are very tender, 1 ½ to 2 hours.
Remove the ham shank and let cool for 5 minutes. Remove the meat from the bone and shred into bite-sized pieces. Discard the bone.
Return the meat to the Dutch oven. Stir in the bell pepper, brown sugar and carrots. Bring to a simmer and cook for 30 minutes, or until the vegetables are tender.
Ladle the soup into bowls and garnish with crème fraîche and sliced green onions.
The soup can be stored in an airtight container in the refrigerator for up to 1 week, or it can be stored in quart-sized freezer bags and frozen for up to 1 month. To reheat, remove one portion of soup from the bag and place in a large pot. Cook over medium-low heat, stirring occasionally, until heated through, 15 to 20 minutes.