TL;DR - 42 minute connection in PTY perfectly doable as long as AA allows you to book it but you'll go thru gate security
On 9/3/16, as part of a vacation/EQM run, I had a 42 minute connection in PTY. The incoming flight would land at 2:59PM and the outbound would leave at 3:41PM.
Both my flights had the same flight number and they were both the same plane type (Embraer ERJ-175) so I was pretty sure it would be the same plane and therefore zero chance of me not making the connection. I even had the same seat on both flights and wished I could have just sat on the plane but of course, they don't allow you to do that (I actually did ask the FA for confirmation).
I actually met the 2 bloggers from www.nomascoach.com after they noticed my Flyertalk luggage tag. This was the first time someone talked to me about it. I've only had the tag for a couple of months though.
So once we landed, I got off the plane but I couldn't go directly into the waiting area. It's roped off. So I went directly to the gate security check area and went thru the security.
Every time I've gone thorough, they're really annoyingly thorough/picky and this time was no different.
So no need to go thru customs or immigration, just the gate security. And 42 minutes is way more than enough but not enough time for me to consider going to a lounge.
Then when I got on board again, (they announced business class first), the FA was surprised when I said 'nice to see you again' and she asked what I'm doing. She hadn't heard of mileage running so I was explaining it to her when another Flyertalker boarded and overheard what I was saying, turns out we had exchanged messages on Flyertalk previously about being on the same flight, we had a nice chat.
On both the flights, it was nice to meet who understand you and what you're doing, rather than tell you you're crazy.