Place kidney beans in a bowl with water to cover. Soak 8 hours to overnight. Drain.
Combine soaked beans, ham hocks, and broth in a large stockpot over medium-low heat. Simmer until beans are tender, 45 minutes to 1 hour.
Stir sweet potatoes, potatoes, onion, carrots, scallions, Scotch bonnet pepper, garlic, thyme, salt, and black pepper into the stockpot. Let simmer until vegetables are soft, 30 to 45 minutes more. Add coconut milk; simmer soup until flavors are mingled, about 10 minutes more.
Remove ham hocks and puree soup with a stick blender.