If it fits the meter it'll be fine - structured poetry (including song lyrics) is more about the delivery of the poem than conventional delivery of the words. You could even abandon conventional syllables (like "crew-el" for "cruel" in "Good King Wenceslas" - though "fyoo-oo-el" was trying a bit too hard).
In this case (and further to DPT's comment) you're seeing :
The small pi / geon ran to / the edge of / the forest
but - as indicated - the meter emphasises the middle syllable, so "pigeon" would be unstressed and "forest" would emphasise the first syllable as normally pronounced :
The small pigeon ran to the edge of the forest
It's worth considering whether the verse might be interpreted dipodically (https://www.poetryfoundation.org/harriet/2007/11/dipodic-verse) or differently - for example as "the small pigeon / ran to the edge / of the forest" - and whether there's a risk of a Mondegreen (https://en.wikipedia.org/wiki/Mondegreen), but in this case I don't think there's too much danger of people wondering why a small pea, whose name was John, was running to the edge of the forest.
The line as you've written it looks fine to me.