Well the OED is more likely to be right than I, but...

I would have thought the most likely orgin IS the notion of the strutting self-confident cockerel, which is not a modern idea but is at least as old as Chaucer's tale of Chanticleer and Perdelote around 8 centuries ago.