In 1776, Spain created the viceroyalty of Rio de la Plata from the viceroyalty of Peru, and included a small strip of coastline on the Pacific. I can’t seem to find a motive for this, other than that the strip in question was under the jurisdiction of the Real Audiencia of Charcas, which was transferred to Rio de la Plata.
Could you link to a map or something, so I can make sure I understand exactly what you're looking at?