Weird Hyundai Problem

I have a 1999 Hyundai Elantra with 146,000 mile… runs GREAT… been very dependable since buying it new. BUT… for the past 3 summers now, on the occasional HOT day, I start the car as normal but the gear shift gets STUCK in Park… and I can’t press the button on the side of the shift handle… this may last 2 minutes or up to a half hour. Eventually, so far at least, it does clear and release and it’s fine again. This doesn’t happen all the time and ONLY happens on HOT days…