Having a new cable won't be a waste - they do go bad. If you have the stock plastic bushing that connects the cable to the linkage, consider replacing that as well (or get one for a spare - the stock ones disintegrate and leave you stranded. Only takes a few min to change out.
Re: removing key in reverse - unless your key is really, really worn, you shouldn't be able to remove it in any position except Park. Which makes me think something is out of alignment or broken (in the 'olden GM days', the neutral safety switch would be a prime offender; not sure if that would still be the case with our trucks.)
Another possibility might be the ignition switch, which are also known to go south (but people tend to report different/ additional symptoms when they go south).
@MAY03LT has a good YT video on a good spare parts kit to keep in the truck - things that go w/o warning and some will strand you. The bushing for the shift cable and the ignition switch are two items on that list (for me, I was glad I had the low beam headlamp relay ready to go when it went out).
Anyway - you may have a little more to replace than the cable, so be aware. As
@Mooseman said...at least it's not the trans itself!