Since there's no apparent motor wire damage, then the next place to investigate is that box.
Please post pics of the box and the wires inside it; they may help us help you find the problem.
For instance, if the wire that is not connected is the "phase speedo" wire some controllers have, that is rarely used, it's actually a tap off one of the motor phases. If that is intermittently shorting (from vibration) to something (like the box itself if it's metal, and connected to some other voltage potential or ground), it would also do what you describe.
Please post pics of the box and the wires inside it; they may help us help you find the problem.
For instance, if the wire that is not connected is the "phase speedo" wire some controllers have, that is rarely used, it's actually a tap off one of the motor phases. If that is intermittently shorting (from vibration) to something (like the box itself if it's metal, and connected to some other voltage potential or ground), it would also do what you describe.