Add beans to a large saucepan and cover with water. Bring to a boil then add in onion, scallions, garlic, allspice, thyme, Scotch bonnet (if using), ginger, 2 teaspoons salt and 1/2 teaspoon pepper. Stir in the coconut milk and bring to a boil. Reduce to low and simmer until beans are tender, about 1 hour.
Add rice to the pan and bring to a boil. Reduce heat to low and simmer until rice is tender and liquid is absorbed in, about 20 minutes. Remove pan from the heat but keep the lid on for 10 minutes. Remove the thyme stems, allspice berries and Scotch bonnet then fluff with a fork. Check for seasoning and add salt and pepper if needed. Garnish with scallions.