The candied bacon can be made a few hours ahead.
Preheat the oven to 400°. Line a large rimmed baking sheet with foil and set a wire rack inside. Arrange the bacon on the rack in a single layer. In a small bowl, mix the brown sugar and cayenne. Sprinkle over the bacon. Season with pepper. Roast until the sugar is bubbly and the bacon is crisp, 20 to 30 minutes. Let cool. Coarsely chop the bacon. Pour the drippings from the baking sheet into a large skillet.
Bring a large pot of water to a boil. Salt the water and add the green beans. Cook until crisp-tender, 5 to 7 minutes. Drain the green beans. Heat the drippings in the skillet with the rosemary over medium-high. Add the green beans and toss until coated. Season with salt and pepper. Cook, tossing often, until heated through, 3 to 5 minutes. Mix in the vinegar. Stir in the bacon.