سَارَ زَيْدٌ وَخَالِدٌ: Khālid is nominative and shares the predicate with Zayd; this is coordination.
سِرْتُ وَالنَّهْرَ: the river does not walk; the wāw expresses accompaniment, and an-nahra is an accusative mafʿūl maʿahu.
Decide by meaning and syntax, not merely by spotting wāw. This contrast is an added teaching example, not a new quotation from the text.