I've searched but haven't seen this posted. We ran into this twice last night in an MP game:

Catapult is 2 away from a city, but not "set up" for ranged attack, mouse over city, tooltip says "ranged" and predicts 2 damage for the city, none for the catapult.

Right clicking (which normally performs the ranged attack, but shouldn't when the unit isn't "set up") causes the unit to perform a MELEE attack against the city, causing 1 or 2 damage, and, of course, die in the process.