When the gearshift lever is moved to the "P" position or the door is opened, the ZE20/40 shall be equipped with a mechanical parking pin which is automatically engaged to prevent unintentional vehicle movement in the event of driver inattention.
In newer models, they have removed this completely and now it relies solely on the handbrake. There is a chance that on a slope, the parking pin will be under tension and will not be able to disengage. Repeating this behavior can cause the parking lock to recalibrate and eventually it will also start not engaging.
If I'm not mistaken, there should be a manual switch under the plastic cover.
In some cases this part is a component of the immobilizer (I don't know about Renault), so replacing the part can be a difficult task.
Could you please tell me the exact model of your ZOE?