Parking Brake
The parking brake system consists of the following components:
Parking brake control and front cable assembly
Rear parking brake cables
The parking brake system is a mechanical system that activates a self-adjusting brake ratchet system within the rear brake caliper.
The parking brake system is cable-actuated and controlled by an independent foot-operated parking brake control. The parking brake system is actuated when the parking brake control is pressed and released by pressing the parking brake control a second time. The parking brake control applies tension to rear parking brake shoes through the front parking brake cable and conduit, and the LH and RH rear parking brake cables. The respective rear parking brake assemblies are then applied.
The parking brake cable tension is self-adjusting inside the parking brake control.
==
Basically, all mechanical so you have to check the cables, the rear calipers, the whole shebang. Seems like the range sensor may not be detecting shifter in park correctly? Next time it does that in Park, move to Neutral/Drive etc then back into Park and see if it works then.