Hi and welcome to just answer
Sorry for the delay in asnwering your question.
The first thing to check when this happens is to see if the brake lights work when you put your foot on the brake pedal. The selector relies on the signal from the brake light switch to allow you to move the gear selector. If the all the brake lights fail to come on then you are more than likely looking at a fault with the brake light switch and these are known to play up.
I hope this helps and if I can help you further please feel free to ask.
Hi if the brake lights are working ok then the next thing to have done is to have the fault memory of the automatic transmission checked for fault codes. Or check the fuses and live feeds to the brake indicator light by the gear lever. I'm able to supply you with a wiring diagram if you would like one to help with this?