Maybe the coins were used to buy Chinese silk and then got from China to Okinawa.
It’s likely that the coins were just used as payment along a chain of buyers and sellers until they reached there.
Being made from real precious metals, they still had value no matter where they were used even if they came from some weird place that the final holder had never heard of.