The ability works even if you sacrifice your last swamp to activate it. It only checks for a swamp on activation.

Artwork
Loading artwork…
Coffin Puppets
Prophecy · #60 · EN
Nonfoil—Foil—
Card rules
Sacrifice two lands: Return this card from your graveyard to the battlefield. Activate only during your upkeep and only if you control a Swamp.
3/3
The ground won't accept them.
Rare · Illustrated by Arnie Swekel
Format legality
Commander Legal
Duel Legal
Legacy Legal
Oathbreaker Legal
PreDH Legal
Premodern Legal
Vintage Legal
Alchemy Not Legal
Brawl Not Legal
Competitive Brawl Not Legal
Future Not Legal
Gladiator Not Legal
Historic Not Legal
Modern Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
Penny Not Legal
Pioneer 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