This is one of the main frame ground points, so it definitely needs to be connected up. The wire goes into the main harness and is used to ground various circuits. There must be another ground if all systems work, but I think it just came loose when you took off the bodywork. On mine it sits on the frame, the body panel goes on top, then the bolt goes through. The body panel is the rear tail light section, and that bolt is the last mounting point towards the front of the bike. There is a grommet below the bolt that the side panel clicks into.