Ender 3 Z-limit now unreliable - possible causes and solutions?
I've just bought an Ender 3 Pro and as a guess I would look at the Z axis stepper motor to see if it is not holding position once it stops... the stepper motor has power on it all the time it is stopped to hold it in position.

I would check the plug that feeds power to see if it is damaged or not making good contact.