From what you show, there could be a few assignable causes and a couple of contributing factors.
It does not look like a lens-based artifact due to the horizontal zone where the ghost appears. It appears to have a rather definite, but not sharp, cut-off. The areas affected are detailed which rules out haze or flare. They are not reversed so they are not reflections, etc.
I do not know the camera model but I think the shutter must travel vertically, given the limited vertical extent of the affected area.
It does not appear to be shutter bounce which appears in older cameras with heavier shutter curtains near the edges of the image.
That points to shutter speed timing but not a malfunction, per se.
Lighting: Outdoor gas discharge lights (Argon, Sodium, Neon, others?) are not continuous and pulse in sync with alternating current. In North America it's 60 CPS and in Europe 50 CPS. The ghost could be the overlapping of a second source while the shutter slit was traversing the sensor. Given the difference between the primary and ghost, a second source is a plausible explanation.
To begin to nail-down the answer,
We'd need to know if supplementary lighting was used. What kind. Where located.
We'd need to know if other shots immediately before or after were similarly affected.
You mentioned it happening sometimes. Do you have a second shot?