My ac vents close when I go up a hill and open when I go down the hill and decelerate the vents open allowing cool air into the cab. It reminds me of my old Jeeps with vacuum wipers. When you go up a hill they slow down to almost a stop but when you decelerate the go like a bat out of hell.
You have a vacuum leak in the ventilation control system. Most likely the the blend door actuator or line to it.
Your a/c is a closed and independent hydraulic system when it is working right. But your cabin vents are likely controlled by vacuum. I can only guess that you have a slight vacuum leak that might get worse as you ascend a grade and improve as you descend. Moisture in the system might be the cause. Your cabin’s vents might be opening and closing according to altitude or just pitch.
I think this is likely. I can’t recommend a solution, however.