I’m having the same issue with my 2013 Altima. Great car, but I’m noticing a lot of little things for a vehicle with only 66k miles on it. I should not have any issues with the gear shifter. Took my car to a mechanic who thought at first it was just the break light switch, which he has seen in the past. Still didn’t fix the issue. He called a Nissan technician friend who stated that most Nissan models are having this issue and that it’s the Shift Lock Solenoid, a cheap little plastic piece that needs to be replaced. He told me to call Nissan and find out more, so I did. It’s going to be a $450+ fix. Absolutely ridiculous.
It’s a six year old car. Things break. I also have little tolerance for things like this, so I spend a lot of money getting a new car every three years.