The gear shifter is loose.
That’s a tough one to figure out without actually looking at it. There’s a roll pin and a spring to attach the lever to the column. The position of the shifter P,R,D etc, is held in place by a mechanism in the transmission. It will need to be determined if there is a part broken, or a loose fastener. I’d suggest having a qualified mechanic, such as one from YourMechanic, inspect the mechanism for you.
Our certified mechanics come to you ・Backed by 12-month, 12,000-mile guarantee・Fair and transparent pricing