Rinse the rice under cold running water until the water runs clear. Drain well and set aside.
In a large pot, heat the vegetable oil over medium heat. Add the garlic and green onions and sauté for 2-3 minutes until fragrant.
Add the coconut milk, water (or chicken broth), and stir in the drained kidney beans, thyme, allspice, salt, and pepper.
Carefully place the whole Scotch bonnet pepper on top of the mixture without breaking it (for flavor without too much heat).
Bring the mixture to a boil, then reduce the heat to low. Stir in the rice.
Cover the pot with a tight-fitting lid and simmer for approximately 20-25 minutes, or until the liquid is absorbed and the rice is tender. Do not lift the lid during this time.
Remove the pot from heat and let it rest, covered, for about 10 minutes.
Carefully remove and discard the Scotch bonnet pepper. Fluff the rice with a fork before serving.