Preheat the oven to 375 degrees and lightly grease a 9-by-13-inch baking dish.
Melt the butter in a large skillet over medium heat. Add the onion and cook until softened, about 3 minutes.
Add the chicken pieces to the skillet and season with salt and pepper. Cook until the chicken is no longer pink on the outside, about 5 minutes.
Sprinkle the flour over the chicken and onion, then stir for 1 minute. Slowly pour in the chicken broth and milk while stirring to create a smooth sauce.
Stir in the rice and carrots. Bring the mixture to a gentle simmer, then remove from heat.
Pour everything into the prepared baking dish, cover tightly with foil, and bake for 35 minutes.
Remove the foil, stir in the frozen peas, and bake uncovered for 10 more minutes until the rice is tender and the liquid is absorbed.