In basic terms, you're right: A cord is a cord.
The two modular handset cords you have used both consist of a coiled length of 4-conductor wire with modular plugs on each end.
Now let's look a bit closer and see what could go wrong.
First, after years of use, the conductors inside the wire could be going bad. Each wire is a length of copper foil wound around a core and insulated from the others. The foil can crack, resulting in poor or intermittant sound in one cord. If the break is near a jack, you may be able to shorten the cord a bit, cutting out the bad spot.
Second, the junction between the cord and either plug could be going bad. Same result. You may need to crimp on a new plug.
Third, the connection between the conductors in the plug and those in the jack (at either end) could be imperfect. Check for oxidation or corrosion or gunk accumulated on the metal parts of the plugs and jacks. Clean and burnish as needed. Also check to make sure the wires visible when looking into the jacks are straight, parallel and bent at an angle that will firmly contact the conductors in the plug.
I have a wall phone in the kitchen that periodically needs cleaning and adjustment of the wires in the handset. I can tell it's time when I pick up the handset and don't hear a clear dial tone or someone tells me they can't hear me. Wiggling the cord near the plug usually cleans off the contacts enough to get me through a few more calls.
I use a dental pick to scrape the connecting surfaces and to realign the wires in the jack.
The next step is to retire the phone to the display shelf and replace it with one that has a hardwired handset cord!