This true bug in the family Coreidae is probably Leptoscelis tricolor. It’s #5 on this plate from the electronic Biologia Centrali-Americana. It also matches these photos from the Smithsonian Tropical Research Bocas del Toro Species Database (Bocas del Toro is only 30 miles or so from where I took this photo). Finally, the Costa Rica Biodiversity Portal only shows two species for this genus. These photos from STRI eliminate the other species, Leptoscelis quadrisignata.
This coreid is commonly known as the heliconia bug simply because it’s often found feeding on heliconias.