Join Date: Sep 2012
Location: MDE
Programs: AA EP, CM PP, AV GM, UA Silver, SPG Gold, Hilton Diamond, Hyatt Plat, Marriott Plat, Accor Plat
Posts: 1,002
Those of us in my company who travel regularly MDE-PTY-SJO schedule 33 minute connections, and I don't recall one ever being missed. Our arrival and departure gates in PTY are almost always a long way apart, too.
The extra 15 minutes on the OP's schedule is more than enough for USA-departure security. They won't shut the door in the rare event that someone is in that line at the scheduled time of departure.
IME, the only way for this to go wrong is for the LIM departure to go mx.