Preheat the oven to 220°C. Sprinkle both sides of the chicken breasts with salt and pepper.
Preheat a large, oven-safe frying pan over medium-high heat for 2 minutes. Working quickly, melt 1 tablespoon of the butter, swirling it around the pan. Add the chicken, skin side down. Add the shallots, cut side down and not overlapping. Cook until the chicken and shallots are browned on the bottom, 2 to 3 minutes. Flip the shallots and chicken, nestle in the rosemary sprigs, and then carefully pour in the chicken stock.
Transfer the frying pan to the oven and roast until the chicken is cooked through and the shallots are tender, 12 to 14 minutes, removing the smaller pieces of chicken first as they become cooked. Transfer the chicken to a serving plate.
Check the frying pan with the shallots to make sure the stock has not evaporated; if less than a few tablespoons remain, add 1/2 cup more stock or water. Reduce the pan juices over medium heat until about 1/2 cup of liquid remains, about 2 minutes. Remove the frying pan from the heat and stir in the remaining 2 tablespoons of butter with a wooden spoon to thicken the pan sauce until it coats the spoon. Remove the rosemary and season the sauce with salt and pepper. Spoon some of the sauce over the chicken and shallots and the rest onto the plate.