That can happen (even with an OEM Apple cable) if it's been "compromised". I've seen it before in an Apple OEM Lightning cable where it had been excessively flexed at the connector.
Apple doesn't sell one that long, so I'm guessing it's aftermarket? If it's MFi certified then you should see if there's a warranty from the manufacturer. They all have different terms. In my experience Apple will only provide a warranty replacement if the jacket shows no signs of external damage.
If it's not MFi then I've seen quite a few that reported "Accessory Not Supported". Sometimes that only happens after an iOS update. I've even had one knock out my MacBook Pro, although I was able to get it working again by disconnecting the battery.