It's also not limited to words pronounced poetically. Some words where both variants are common, like "wicked", have different numbers of syllables depending on meaning. e.g.
Beads of sweat wicked through the wicked witch's black robes a hot summer day