Hard wire the motor to a battery and check again, erratic behaviour is usually down to broken wires, from where the loom crosses over to the tailgate, pull back the rubber tube, (top left when the tailgate is open) and check for broken wires....
Its unlikely that the motor is worn out, as they get little use, but may need a little TLC, stripping, freeing off, lubricating, etc...
Thom