It's been a while since I looked at it, but I thought two different creatures with the same CR may have different XP?
All monsters with the same CR have the same XP -- you can confirm this based on the list of monsters by CR in the DM Basic Rules. However, that doesn't mean that two encounters based on the same XP total will have the same challenge, according to the system.
Say you have a party of 5 14th level characters, and you decide you want to build a hard encounter for them. Based on the guidelines in the DM's Basic Rules, you should target 19,000 XP for that encounter -- 5 x 3800 XP listed in the 'XP Thresholds by Character Level' chart.
So you figure you can do a single adult red dragon (CR 17 = 18,000 XP), but that might be boring. Instead, you decide to go with a pack of 11 trolls (CR 5 = 1800 XP). Except that, according to the system, a pack of 11 trolls is actually significantly more challenging than a single adult red dragon; you're supposed to multiply the XP times 3 to determine the XP difficulty for a group of 11-14 monsters, and doing so results in a difficulty calculation of 59,400 XP, which should be considered a deadly encounter for a group of five 19th level characters.
Except, if you've played much, you already know that a group of 11 trolls isn't anywhere close to a deadly encounter for 5 14th level characters, much less 5 19th level characters. So in that sense, the OP's complaint is accurate -- the CR system for building encounters doesn't really work as a measure of potential challenge (though it works fine for pacing your group and making sure they only hit certain levels after a certain number of encounters).
On the other hand, the complaint also seems misguided, because the definition of 'challenge' appears to be defined as 'the party might get killed'. Even the definition of a 'deadly' encounter in the DM's Basic Rules doesn't define it as 'TPK', but rather 'could be lethal for one or more characters'. If you are trying to build a campaign where any individual encounter could result in a TPK, then you are not running a 5E campaign as the game was designed to be run. If that's the game you want to run, then go ahead and ignore the CR system for building encounters, because it doesn't do what you want to do -- a 'medium' encounter is defined as 'the characters should emerge victorious with no casualties. One or more of them *might* need to use healing resources' (emphasis mine), which I'm guessing is what the OP is referring to as a 'cake-walk'.