The answer to If a hacker is infected as a result of their actions, is the victim liable? that explained laying a trap to injure someone could go either way depending on the severity of the injury and the threat the criminal posed made me wonder about a case where the person laying the trap reasonably didn't expect it to cause injury.
To extend the hacker example from the initial question, and sidestep the question of physical harm, what if the trap was a ransomware virus that required the hacker to contact the intended victim to get a key to unlock their encrypted files? If the intended victim provided the key as promised, but gave the hacker's contact information to the authorities and reported their intrusion, was the hacker legally injured?
Would it make a difference if the intended victim's system was a honey pot intended to attract criminals?
Would it make a difference if all the virus did was "phone home" so that the hacker could be traced, but didn't encrypt any files?
Would it make a difference if the system had some sort of warning on it that intrusion attempts could result in a counter attack? I'm not sure how such a thing would be implemented, but let's assume it would be similar to a sign posted on a property boundary indicating some sort of danger to trespassers.