Clearly Joy Boy had some objectives and when he didn't achieve them he promised Poseidon that somebody else will do it. He even had history of the Ancient Kingdom scattered throughout the world in the hope of preserving it. So, he failed and went for a back-up plan.
On the other hand, Ryuuma protected Wano against all attackers. If Ryuuma and Joy Boy were from the same era, then the attackers are the ones who managed to force Joy Boy into back-up plan.
Another thing is, Ryuuma protected Wano against Pirates too. I don't know if pirates existed in the void century.