Not sure where your information was obtained, but from looking a books from the period, New Spain produced far more revenue and silver than Upper and Lower Peru combined, and had done so since the 1670s. In 1804, the Spanish Crown collected 36 million pesos in revenue, with 62% coming from the Viceroyalty of New Spain, 16% from New Granada, 11% from Peru, and another 11% from La Plata.
Going to Lima would also have been an insanely long and dangerous voyage. The trip in ideal conditions would have required sailing two months from Seville to Portobelo and another 2 weeks sailing through the Chagres, where it was very common for sailors to die of fever. From there they would be sailing against the Humboldt Stream which could take another 3 months and ideally done from September till April. The other option would be sailing to Cartagena and going by mules to Lima which would take several months.
By contrast, Sevilla to Veracruz took about 2.5 months with another 21 days overland to Mexico during dry season and 31 during the rainy season. Neither would be ideal, but one can see why Ferdinand originally sought refuge in New Spain.