The gemara has a machlokes whether m'doraysa a damage that is not recognizable is considered a damage that one is liable for. Simply speaking the peshat of "hezek she'eino nikar" being patur is that it doesn't qualify as an act of damage. Similar to grama which is patur because it isn't considered an act of damage (just that by grama they don't even make a penalty to compensate since there wasn't any act done at all, whereas here there was at least an act done - as Tosafos Rid explains). However, this approach doesn't fit well with the gemara that says that if one steals a coin and the government then discontinues it, or chometz and pesach comes and assurs it from benefit, the thief can simply return the item as is - this proves "hezek she'eino nikar" is not called a damage. Tosafos questions this comparison. Perhaps when one does the damage actively, just that it is "hezek she'eino nikar", it will qualify as a damage, but here the act of damage happened by itself i.e. the government discontinuing the coin, or pesach assuring the chometz b'hana'ah. Why is this conclusive evidence that "hezek she'eino nikar" is not called a damage? Tosafos is forced to answer that if "hezek she'eino nikar" is called a damage, it is no longer considered the same item that was stolen and therefore the gazlan acquires it b'shinuy, and fully responsible. From the fact that he is not responsible indicates that "hezek she'eino nikar" is not called a damage.
This doesn't fit well into rashi who writes: מכדי מיגזל גזליה מדמשכיה וקם ליה ברשותיה, וכי קמשלם ליה דבר הניזק משלם ליה ולא כמה שגזל. Rashi seems to hold that the problem is in the pay back of the item rather than the gazlan acquiring through shinuy like tosafos says. Also, rashi seems to imply that the gazlan acquires the item through meshicha, prior to the government decision to discontinue the coin, and prior to pesach making the chometz assur.
Perhaps rashi holds that the rationale behind "hezek she'eino nikar" not qualifying as a damage, is that although the act of damage may be considered an act of damage, since the damage is not recognizable in the item, the actual object is considered the same that it was. Therefore, as soon as the damager does the act of damage, it is as if he returns the item to the owner as compensation, and the item has no recognizable damage in it, and is therefore considered a valid reimbursement for the damage. Based on this approach, it is easier to understand the connection to a gazlan. The main issue is in the pay back of the item - do we consider it to be the same item? If "hezek she'eino nikar" is not called a damage then we consider it to be the same item, but if "hezek she'eino nikar" is called a damage then we don't consider it the same item. Therefore, a gazlan who returns the coin after it is discontinued or chometz after pesach, if "hezek she'eino nikar" is not called a damage, he is essentially returning the item that he stole and is considered a valid reimbursement. That is what rashi means: וכי קמשלם דבר הניזק משלם ליה ולא כמה שגזל, meaning that since it is called a damage we don't consider it the same item, but if it would not be called a damage it would be the same item.