Makes sense, but it's reflected in the "original price" too. Ie. The acquiring team would get a "discount" on the player if he's overpaid by 2M, but would have to pay a premium to get a player underpaid by 1.5. So, to get from 2M overpaid to 1.5M underpaid, the difference in value is 3.5M overall.
Using picks for illustration.
In your example, player X is paid 7M but worth 5M, then he's slightly overpaid but still a good player (and if the cap rises it could become a decent cap hit). Perhaps his value is a 3rd round pick (in which case it might be better to keep him until he can be a high value rental).
But if the player was paid 5M, he'd be worth a 2nd rounder, because he'd be a good player on a fair contract.
If you retain to 50%, then the player's cap hit is 3.5 - making his contract solid value, then maybe he's worth a 1st rounder.
Of course some players, under circumstances, have negative value and you need to pay to get rid of their contracts. But, Anderson's not one of these cases. His trade value is affected by being overpaid, but he's still a valuable player.