Preheat your oven to 350°F (175°C).
In a large skillet, heat olive oil over medium heat.
Add the sliced onions and cook until caramelized, about 15 minutes, stirring occasionally.
Add garlic and diced chicken to the skillet, cooking until the chicken is browned and cooked through, about 7-10 minutes.
Pour in the chicken broth and heavy cream, stirring well to combine.
Add the orzo to the skillet, stirring to ensure it's evenly distributed.
Season with salt and pepper, then bring to a gentle simmer before removing from heat.
Transfer the mixture into a greased 9x13-inch baking dish.
Top with shredded Gruyère and mozzarella cheese, spreading evenly.
Bake in the preheated oven for 25-30 minutes, or until the cheese is bubbly and golden.
Remove from oven and let it sit for 5-10 minutes before serving.