I think your last sentence is actually the best explanation, if you replace ‘but’ with ‘AND’.
The current leadership of Nicaragua is hostile to the United States of America, and is also part of the Bolivarian Alliance of the Americas, a left-wing intergovernmental organization where the other members are closely allied with the People’s Republic of China.
This does two things at once: it puts another finger in the eye of the United States while also seeking to win over Nicaragua’s regional allies. I think that a map From the article is a great picture, it shows how basically NATO and a few US allies are voted against so many countries in the developing world.
The message itself is a great example, given by the Cuban actor. Cuba is Nicaragua’s oldest ally in the region. The current Nicaraguan president even spent some time in Cuba in exile before the Nicaraguan revolution succeeded.
Somewhat counterintuitively, I think this has nothing to do with China itself or trying to curry favor with the People’s Republic of China. Especially since this does not affect Taiwan at all.