Continuing the discussion.
Let's look more closely at the flying birds (Eumaniraptors/Paraves) and the flightless maniraptor birds (eg. Ornithomimosaurs).
We have seen that these two groups are very closely related and that the flightless maniraptoriformes birds developed from the flying birds.
As some flying birds (of different kinds, in different places) settled on the land, they lost their flying-bird characteristics and became flightless.