Public Execution targets only the creature it destroys. If that creature is an illegal target when Public Execution tries to resolve, it won't resolve and none of its effects will happen. No creature will get -2/-0.

Artwork
Loading artwork…
Public Execution
The List · #M13-105 · EN
Nonfoil—Foil—
Card rules
Destroy target creature an opponent controls. Each other creature that player controls gets -2/-0 until end of turn.
Though the executioner did not speak, the villagers got the message.
Uncommon · Illustrated by Anthony Palumbo
Format legality
Commander Legal
Duel Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Penny Legal
Vintage Legal
Alchemy Not Legal
Brawl Not Legal
Competitive Brawl Not Legal
Future Not Legal
Gladiator Not Legal
Historic Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
Pioneer Not Legal
PreDH Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Timeless Not Legal
Tlr Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
Only creatures controlled by the player when Public Execution resolves will get -2/-0. Creatures that enter under that player's control or that the player gains control of later in the turn are unaffected.
If the target creature regenerates or has indestructible, each other creature controlled by that creature's controller will still get -2/-0.