It can be stuck linkages as they do not operate top full position the motors which contains the lock/unlock switches view it as not in either so cycle between the two until it finally gets to one position.
I just clean up all the linkages take off door panels(front) and see exactly what is happening travel wise, often just a clean and grease up sorts them out.
tabetha