Boot loop, random locks, flashing does not help [Galaxy S4 VE GT-I9515]

I am in a desperate situation. I have been using an unofficial LineageOS port for almost 2 years. I was going to give the phone to my friend as a Christmas present, he only has a mini S3 with a broken glass. Literally, minutes after I paid for my new (used) phone, my S4's screen went completely pink at the same time I received a message. The vibration of the notification of the message became a loop while the pink screen remained on. I used to get the pink screen from time to time, but usually only for a fraction of a second. After that I just had to lock and unlock the screen to continue the operation. Several other users have reported this minor error.

After removing the battery, the phone would enter a boot loop. I started again several times and restarted once after several minutes of a black screen, but before I could do anything, how to save the current day's data, it turned pink again. The worst part is that I could not even enter the recovery for any reason, it would simply restart but never go beyond the Samsung home screen. The download mode worked at the beginning, so I took the opportunity to flash other TWRP ROMs and managed to start the recovery once, again, just a few seconds before the screen turned pink.

After these experiences, he behaved as if the battery ran out quickly. The amount of time that the welcome screen would be displayed decreased from the full time to only a fraction of a second. Similarly, when I plugged in the charger, it would only show the charging logo before shutting it down again. After several attempts, it would not even vibrate when connecting the charger.

I thought that my S4 had died in me, and that I had seen it disappear slowly and painfully, until, after several hours of charging, it came on suddenly, but only for the Samsung home screen. After that he seemed completely dead again. A fairly random behavior, but at least a small sign of life.

I already tested my previous battery, which allowed me to turn it on for a while, before playing the same behavior until it did not turn on again. Luckily, now I've got a third battery (the original three Samsung), and with that it will turn back on immediately, and will enter a boot loop after the Samsung home screen. However, this time I was able to enter the recovery on the first attempt, so I tried:

  • Clean cache / Dalvik
  • LAS last flash from the first post
  • Cleaning system / cache / Dalvik
  • LAS last flash from the first post

In that order. The first options resulted in the same start loop as before, while the last ones finally showed the LOS start screen for a couple of seconds, until the screen turned pink again. I had to remove the battery to start over.

So I finally left LOS and tried to flash Stock with Odin, as long as I was allowed to enter download mode. Everything went normal, but now, after the Samsung home screen, it just stays black. Tried again, now the screen just stays black for a couple of seconds until it resets. How can that be after a flash Stock ROM?

So I let the battery fully charge. For the first time since the problems start, the LED will turn on, first red and then green. I pressed the power button and here, the Samsung boot animation appeared (after the home screen). I waited for several minutes (normal after Stock flash) until it went back to the boot cycle.

I could not even restore the factory settings because the Android recovery value icon would only show up for a couple of seconds before the boot cycle resumed. So I went back to show the last TWRP and started blinking LOS when, after several seconds, the screen turned pink again. I tried blinking with Odin once again, the phone went off in half. I just completed my third stock flash and went straight to the boot cycle. However, this time it allowed me to enter the stock recovery and did a full factory reset + I deleted the cache partition. Still stuck in the boot loop.

I am at the end of my wit.

Edition: I tried it with a stock ROM of a different operator, with the same result.