I have had a think about the last few times I've "snapped a cable" in the handlebar's gears selector. Thinking about each of the last 3 or 4 times this has happened to me, for the preceding few weeks, I've found myself unable to correctly index all 7 or 9 gears at the back. Either I've managed to index the bottom half of the range, the top half or a chunk in the middle... And now I've sat and thought about it:
It may well be that if the cable is in the process of "dying" where each of the strands are breaking / snapping / coming undone from the end stop at the end of the cable itself, then the cable won't be within the design tolerances of exactly where it should be for all the gears as it is stretched & relaxed, stretched & relaxed over and over and over again. Hence "reindexing" either aligns 3 or 4 of the gears at the top when the handlebar paddle is in the right place for them, or in the midrange or at the bottom end of the cassette.
Yes, cables do naturally stretch over time (without breaking) so a minor adjustment of say ¼ turn or so deals with that - but the next time my indexing begins to go off on its own like this where I can't get all the gears in the right place, I will buy then replace the old cable as a preventative measure. And I am sharing this with others too... If you really can't work out why you can't get all the gears, it may just be the final warnings of an imminent total cable failure.