Preheat the oven to 350°F. Spray an 8 x 8-inch baking dish with nonstick cooking spray and set aside.
Set a medium saucepan over medium heat and add the butter. When the butter is melted, add the onion and cook for 3 minutes, until softened. Add the garlic and black pepper and continue cooking for an additional 30 seconds.
Add the rice and cook, stirring frequently for 2-3 minutes, until very lightly toasted.
Stir in the broth and bring the mixture to a gentle simmer. Add the cut green beans and stir to combine.
Pour the rice and green bean mixture into the prepared baking dish. Cover tightly with aluminum foil.
Place the casserole in the preheated oven and bake for 40 minutes, or until the rice is tender and the liquid is mostly absorbed.
Remove the casserole dish from the oven and remove the foil. Gently fluff the cooked rice with a fork then sprinkle the cheddar and Parmesan cheeses evenly over the top. Return to the oven and bake, uncovered, for an additional 10 minutes.
Let the casserole stand for a few minutes, then serve warm.