Get your oven on at 200°C (400°F) and lightly grease a 9x12-inch baking dish. Set that aside for later.
Melt the butter in a large frying pan over medium-high heat. Add the sliced onions, season with salt, pepper, and half the chopped thyme. Cook for 5–8 minutes until they start to soften. Turn the heat down to medium and keep cooking, stirring every so often, until the onions are soft, golden, and jammy (about 15 minutes). If the pan starts to dry out, splash in a bit of the beef broth to stop them sticking.
If you fancy a bit of extra flavour, pour in the white wine, sherry, or balsamic vinegar. Let it bubble for a minute until it thickens slightly.
Stir in the minced garlic and cook for about a minute until it smells amazing. Then take the pan off the heat and let the onions cool slightly.
Carefully cut a pocket into each chicken breast (slice it in half horizontally without going all the way through), a good sharp knife like this is key for slicing the onions thinly and cutting neat pockets. Season the chicken all over—including inside the pockets—with salt, pepper, garlic powder, and ground thyme. Spoon 1–2 tablespoons of the caramelised onions into each pocket, then stuff them with the shredded Gruyère (or mozzarella) and a bit of Parmesan. Seal each breast with toothpicks to hold everything in place.
Tip the rest of the caramelised onions into your prepared baking dish and stir in the remaining beef broth. Set aside for now.
Heat the olive oil in the same frying pan over medium-high heat. Sear the stuffed chicken for about 4 minutes on each side until golden—don’t worry, it won’t be fully cooked yet. Flip the chicken easily with a sturdy set of tongs like these to keep the filling secure. Lay the browned chicken breasts on top of the onions in the baking dish, I bake everything in a sturdy dish like this, it holds the juices nicely and makes cleanup easy. Spoon a bit of the oniony sauce over each one and sprinkle with the remaining chopped thyme. Bake for 15–20 minutes, until the chicken is cooked through and the cheese is lovely and melty. Take out the toothpicks and serve the chicken with the caramelised onions and pan juices spooned over the top. Perfect with a side of greens or mash!