Rinse the rice in a fine-mesh strainer under the tap until the water runs clear.
Heat the oil in a medium non-stick pot with the stove set at medium heat. Pour the onions and garlic in the pot. Sauté the onions and garlic until the onions are translucent (about 1 minute).
Add the liquid from the canned beans, water, ginger, allspice, scallions, thyme, and scotch bonnet pepper.
Cover the pot with a lid and let the liquid come to a boil.
Remove the scotch bonnet pepper from the pot; you can discard it or use it for something else.
Pour the rice, beans, and coconut milk into the pot. Add the salt and black pepper. Use a wooden spoon to mix everything together, then cover the pot with the lid. For best results, cover the pot first with tin foil then the lid; this helps to trap in steam to cook the rice more evenly.
Let the liquid come to a boil. Lower the heat to simmer and let the rice cook for 35-40 minutes or until tender; use a spoon to gently turn the rice at about the half-way mark to prevent burning.
Remove the tin foil from the pot at about 6 minutes before the rice is done cooking and let the rice cook for the remainder of the time with only the lid covering the pot.