The feat Butterfly's Sting is originally from Faiths of Purity (May 2011), part of the Player's Companion series about which Paizo typically neither answers questions in its FAQ nor issues errata. (Also, in its original appearance, the feat is deity-specific, having as an additional prerequisite worshiper of Desna, that prerequisite omitted from the d20PFSRD site because of the OGL, just so you know.) In other words:
An official answer isn't forthcoming. However, I can present some arguments and offer an opinion.
So we're on the same page, the swashbuckler extraordinary ability panache says, in part, that
Each time the swashbuckler confirms a critical hit with a light or one-handed piercing melee weapon, she regains 1 panache point. Confirming a critical hit on a helpless or unaware creature or a creature that has fewer Hit Dice than half the swashbuckler's character level doesn't restore panache.
And the benefit of the feat Butterfly's Sting says
When you confirm a critical hit against a creature, you can choose to forgo the effect of the critical hit and grant a critical hit to the next ally who hits the creature with a melee attack before the start of your next turn. Your attack only deals normal damage, and the next ally automatically confirms the hit as a critical.
Here are two readings.
Option 1: The swashbuckler restores panache even if the swashbuckler opts to employ the benefit of the feat Butterfly's Sting
The swashbuckler must confirm the critical hit in the first place for either ability to activate, but the extraordinary ability panache checks only that a critical hit is confirmed not what happens after that critical hit is confirmed. That is, an attack roll is made to determine failure or success, if necessary a critical roll is made to determine failure or success, then the player decides what to do with his critical hit as per the benefit of the feat Butterfly's Sting, the panache having already been restored with the successful critical roll.
In short, the effect of having confirmed the critical hit restores the swashbuckler's panache, but the effect of the critical hit itself has been forgone.
Option 2: The swashbuckler does not restore panache if the swashbuckler opts to employ the benefit of the feat Butterfly's Sting
The benefit of the feat Butterfly's Sting must be activated precisely when the swashbuckler confirms a critical hit, and, if it is, it removes any other effect caused by the critical hit. That is, the swashbuckler makes a choice when he succeeds on the critical roll:
- If the swashbuckler picks to employ the benefit of the feat Butterfly's Sting, the swashbuckler must forgo any other effect generated by the critical hit and the swashbuckler's attack deals normal damage.
- If the swashbuckler picks not to employ the benefit of the feat Butterfly's Sting, he gains the effect of the extraordinary ability panache and any additional effect from having scored a critical hit.
In short, succeeding on the critical roll mandates a choice: either the benefit of the feat Butterfly's Sting or the standard effects generated by the critical hit.
Initially, I gravitated toward Option 1, but the word effect as used in the benefit of the feat Butterfly's Sting is enormous and undefined, covering pretty much everything in Pathfinder, including the extraordinary ability panache, and that leads me to believe Option 2 is likely more correct strictly according to the rules. However, the swashbuckler class isn't, like, an arcanist or even a hunter, so were a player to pitch Option 1 while in a party with likewise optimized characters, I'd have no problem allowing simultaneously the benefit of the feat Butterfly's Sting and the restoration of the swashbuckler's panache.
This is an infrequently discussed topic, with a lone Reddit thread. The feat Butterfly's Sting has been by users flagged for the FAQ in this 2013 thread, but it's about using the feat to confirm automatically one's own critical hits later, not this issue.
I suggest if you're serious about forcing the issue that you start a thread on the Paizo messageboards about this specifically. Further, I don't know if this combination is allowed in Pathfinder Society organized play yet or currently, but if it is, a DM to whose table you bring such a character might be forced to ask for an official ruling (although it's possible a hand forced in such a manner will simply ban the combination).