1] Rav Yonason Eibeshitz finds an allusion to the story of Bar Kochba in the psukim!
2] If Rebbe Akiva made a mistake, then how are us Lilliputians expected to know who is moshiach? The Lubavitcher Rebbe answered that we have an advantage - the signs given by the Rambam. Rebbe Akiva didn't have the psak of the Rambam.... But we do so we will know when the "real McCoy" is here and הגיע זמן גאולתכם!!!
3] How could Rebbe Akiva have made such an egregious error? We some from Chazal some very negative things about Bar Kochba - Before one of his battles, Bar Kochba blasphemously proclaimed: "G‑d, if you choose not to help us, at least do not help our enemies," thereby implying that the Jews could be victorious without Divine assistance. On another occasion, Bar Kochba suspected that his saintly uncle, Rav Elazar HaModai, knew military secrets. Enraged, Bar Kochba confronted the elderly Rabbi Elazar, kicking him and causing his death [*]. He would cut of a finger from the hand of his soldiers [ירושלמי פרק ד הלכה ה].
Rav Kalman Ber [who was a Ra"m in KBY in hi sefer מעשה רקם from page 77] suggests that Rebbe Akiva thought that he was משיח בן יוסף who is the predecessor of משיח בן דוד and prepares the military and material backdrop for spiritual redemption.
Such a theory needs a firm basis in the sources which I didn't see. וצ"ע.