This is an idiom that is used a lot by newscasters and commentators in the course of politics, especially during bouts of great national upheaval and times of potential danger. Like now.
Merriam-Webster’s online dictionary provides a succinct definition, saying that a loose cannon is “… a dangerously uncontrollable person or thing,” which nails it, all right.