Even in the present day nearly 50% of the countries population live in the mountains. Stretching from Venezuela to Chile.
The assumption this question is based on is questionable at best. Most Andean countries have their main cities on the coast and even the population centres located on the many branches of the Andes mountains are settled on particularly temperate climates or part of the Andes that are atypically fertile and flat. For instance Venezuela’s main population centres: Caracas and Maracaibo are coastal Caribbean cities, with Caracas settled on a valley that extends into the city’s port: La Guaira. Ecuador’s largest city Guayaquil is also on the coast, as well as Peru’s capital Lima which hosts a 3rd of the country’s population. Similar descriptions apply to Santiago, Cali, Barranquilla, Valencia, Piura, and Antofagasta. The only notable exceptions of large city centres located away from the coast and in the Andes are Bogota, Medellin, and Quito. All of these cities were large settlements conquered and colonized from previous native nations inhabiting these lands, and are located on atypically flat and fertile lands like the plateau “Savana de Bogotá” or the fertile and temperate Antioquia Valley where Medellin is located. Lastly Bolivia has no coast, so it doesn’t have coastal cities. To your point, a large chunk of the population of South American countries still live on the Andes, however this is better explained by the fact that geographically speaking the Andes cover the vast majority of the territory of Chile, Peru, Bolivia, and Ecuador, as well as a a large chunk of Colombia and Venezuela. In other words, despite the Andes mountains covering the majority of the territory of the South American countries it occupies, there is a disproportionate amount of population living in coastal areas.