I know that “by growing into a beautiful swan” is a prepositional phrase modifying “surprises”. At first I thought that “growing into a beautiful swan” was a gerund, but an English teacher from another site said that “growing” was a verb because you couldn’t substitute another noun in its place and because the duckling had to surprise everyone by DOING something. Is she correct? I thought that a verb ending in –ing always had to be combined with the “to be” verb in order to function as a verb.
She was wrong.
You could substitute "its development into".
You are correct. "Growing into" is a gerund acting as the object of the preposition "by". Substitute "becoming" and it might seem simpler. "Swan" is the predicate nominative within that gerund phrase.
Now, that's Reed-Kellogg.