2008 Mazda Mazda3 - Stuck in park

Could not start the car when I tried to start it. Noticed that the shifter handle was stuck in park and that the P light was not lighted up when it was always previously lit when I started the car. After trying to move the shifter sideways in an up and down motion I finally got it back to working and the park light P was lighted up. The car finally started. This happened a couple of times in the last 4 or 5 months. Whatt kind of problem am I dealing with?

2003-2009 Mazda 3 transmission cable /park switch adjustment - YouTube