I always thought it was the Number of Strategic and or Luxury Resources that caused the Ghosting regardless of any other Factors and I have reproduced the Ghosting Problem in Tests if more than 32 S & L Resources were used concerning connected buildings.
I Tested the Un-connected Buildings by placing #33 (Marine Recruits) in one Building and #1 (Tools) in another Building.
The Other Three Un-Connected Buildings had No Resources at all and No Trade or Roads were placed to connect the 5 Un-connected Buildings at all.
The Un-connected Buildings that had No Resources remained the same with No Resources but the Buildings that Had #1 (Tools) or #33 (Marine Recruits) had Both Resources...Ghosted.
The Connected Buildings did Not have any Ghosting that had #1 (Tools). #33 (Marine Recruits) was not Ghosted to them.
Apparently, the Ghosting does not affect the Buildings that are connected if the resource is placed in a Building that is Not Connected. In this case, it only affects the Unconnected Buildings that have either #1 or #33 and only affects those Two Resources.
I Tested the Un-connected Buildings by placing #33 (Marine Recruits) in one Building and #1 (Tools) in another Building.
The Other Three Un-Connected Buildings had No Resources at all and No Trade or Roads were placed to connect the 5 Un-connected Buildings at all.
The Un-connected Buildings that had No Resources remained the same with No Resources but the Buildings that Had #1 (Tools) or #33 (Marine Recruits) had Both Resources...Ghosted.
The Connected Buildings did Not have any Ghosting that had #1 (Tools). #33 (Marine Recruits) was not Ghosted to them.
Apparently, the Ghosting does not affect the Buildings that are connected if the resource is placed in a Building that is Not Connected. In this case, it only affects the Unconnected Buildings that have either #1 or #33 and only affects those Two Resources.