Again, the history of Goju-ryu and it's katas are still much debated and no one knows for sure.
What most all agree is that:
Higashionna learned a southern system of Kung fu while in Southern China.
Upon his return to Okinawa he modified the katas to be more "okinawan" and taught them to some people, amongst them Chojun Miyagi.
Miyagi went to southern China on his own to further develop his Karate.
Upon his return and after sometime if further modified the katas he knew and the new ones he had been taught and brought back from China.
There was much intermixing of katas and training between the different Okinawan styles and they borrowed freely amongst each other.
After sometime, anally retentive "lineage holders" took over and the whole system of freely sharing and cooperating went to ****.
Psalms 144:1
Praise be my Lord my Rock,
He trains my hands for war, my fingers for battle !