I have been having this
I have been having this problem with my 2016 Ram as well, and took some time this weekend to find the cause. My tailgate sometimes opens when the lock is actuated. I can make the tailgate eventually open by cycling the lock repeatedly.
The cause is poor material choices in the lock design. They used plastic as the material on the lock mechanism, and the plastic hard-stops on a steel post protruding from the manual lock every time it cycles. The result is a slight dent in the plastic, which results in the mechanism sometimes traveling too far and unlatching the tailgate. They could have gotten by with the shoddy materials by dampening the force of the solenoid which actuates the lock.
I've temporarily fixed the problem by sliding a piece of plastic tubing over the steel post on the manual lock, but I have an appointment at the dealer to look at it.
If all they do is replace the mechanism, I'll have to dampen the action of the actuator solenoid myself or it'll just happen again.