What Oda is cooking is that the history of the One Piece setting is cyclical. Everything happens in a perfect pattern. The Ancient Kingdom, ruled by the Lunarians, was a tyrannical state that regularly oppressed humans. The humans got sick of this injustice, formed a revolutionary movement under their leader Imu, and overthrew the Kingdom. But as time went on, the World Government became just as oppressive as the Ancient Kingdom was. They became so scared of the Lunarians taking over again, that they committed genocide against their species and later against the Oharans for trying to find out the true history. And since the World Government is nearing the level of technology that the Ancient Kingdom had, that means it's reaching its breaking point just as the Ancient Kingdom did
Joyboy's failure was that he didn't break the cycle