What to check
Stop moving the cable to maintain charge. Compare a second known-good cable only when the socket is visibly intact.
What your result tells you
If a good cable behaves the same way, bring the controller and offending cable for a port inspection.
Manufacturer troubleshooting and reference
Get help with this issue
PlayStation controller charging repair