> "Like there is a short inside and .. gets very hot".
That looks like "CMOS Latchup". That happens if a voltage is applied to a pin that is higher than VCC or lower than VSS. Doing that turns on "Parasitic Devices" inside the chip.
You can learn all about that here:
https://en.wikipedia.org/wiki/Latch-up
Why does it happen at certain cable lengths? Probably because that length of cable is acting as an efficient radio aerial. And maybe someone has a new mobile phone, or some new WiFi or Bluetooth gear in the vicinity.
You have to add protection to inputs like this. Resistors, capacitors, chokes (inductors), zeners. Just adding a cap would probably fix your case. You can't just connect unprotected silicon to "the outside world".
I remember hearing a story/joke about a technician working on a computer system, and having it partly disassembled on the bench in front of him. Then his phone rang with the boss asking "have you fixed it yet?". He answered "It was working until you rang, but now it is dead".
Tom