I would say it’s probably the cable. Check that it is routed correctly on the bike. The cable should be running on the right 1" down tube and inside of the frame cross brace directly under the engine. You might need to change the angle of the Speedo gearbox slightly and keep the cable loose up against the frame and swing arm so it can float. In other words don't zip tie or tape it up too much. It might very well have been pulled apart or it’s about to at the speedo gearbox nut/cable. I would be looking hard at that area.
Cheers,
Thomas
CNN