Hello my name isXXXXX and thanks for your question.
These can be tricky to diagnose when they are intermittent. The shift lock actuator is the most common cause but the concern can also be caused by the brake light switch, wiring and the smart junction box. Next time it happens try to see if the brake lights are working.If they are not then I would suspect the brake light switch or a wiring issue at the brake light switch connector. If the brake lights work then we know the smart junction box is receiving brake switch input and the next step would be to check for power at the shiftlock connector on the orange wire. Some disassembly would be required at that point to access the wiring connector in the console and the problem would need to be present while testing. If the orange wire has voltage with the key on and pressing the brake and the black wire has ground then the shifter will need to replaced. The shift lock actuator is not replaceable separately, it comes as part of the shifter.