Preheat the oven to 200°C (400°F) and prepare a baking dish by spraying cooking spray.
In a large skillet, melt the butter over medium-high heat.
Add the onions to the skillet and sauté for a few minutes until they are soft.
Turn the heat to medium-low and add the garlic, pepper, and thyme. Sauté until fragrant.
Add the balsamic vinegar and beef broth to the skillet, and stir until well blended, scraping the browned bits off the bottom of the skillet.
Simmer the mixture for 10 minutes or until the onions are caramelized.
Transfer 1/3 of the onion mixture to the prepared baking dish and spread it evenly.
Season the chicken breasts with salt to taste, and place them on top of the onion layer in the baking dish.
Spread the remaining onion mixture over the chicken.
Sprinkle the Parmesan and mozzarella cheese on top of the onion layer.
Bake the dish in the preheated oven for about 30 minutes or until the chicken is cooked through.
Remove from the oven and let it rest for a few minutes before serving.