I am an Indian national with a valid visa for Costa Rica. Do I need a visa to transit through Panama?
As stated by Timatic, the database used by airlines:
Visa required, except for Holders of confirmed onward tickets for a max. transit of 12 hours, or until the first connecting flight [to your next destination]
So no, you do not need any transit visas