According to the Apple support team I contacted, it's an LCD malfunction and the only solution is to replace it.
What they didn't say was why this problem is occurring after two years of using the iMac on so many computers.
So, as Apple hasn't yet assumed that it's their fault, what I did, given the lack of concrete answers from Apple, was to take my iMac to a technician and ask him to assess the problem to see if it's a construction problem or just a random fault.
The explanation I was given was as follows:
In terms of circuitry, everything seems to be working properly.
The problem, apparently, lies in a cable that also powers the LCD, which is located on one of the tops of the screen, and which, in order to be replaced, requires detaching the screen glass from the LCD itself, which is a very sensitive operation and almost impossible to carry out without damaging the LCD.
So the only option is to replace the entire LCD (LCD+main boards+screen glass).
Also, according to the technician's explanation, this cable (of the FFC/FPC type or Flat Flexible Cable / Flexible Printed Circuit), it has to sustain a very high voltage (around 50V) to power the LCD (this despite the iMac's power supply being 15.9V), and it heats up a lot!
So, what happens after a while (in this case after about 2 years) is that it starts to burn out and degrade at the connector, to the point where it lets the signals leak between the various connectors and short-circuits some of them, which ends up causing those lines that we are all unfortunately familiar with.
The level of brightness makes a fundamental contribution to this problem. Thus, the higher the brightness used, the sooner the problem occurs.
This is easily understood by measuring the difference in temperature at the top of the screen when it is at its lowest brightness level, compared to when it is at its highest. It's quite a big difference!
When it's at its lowest brightness, it's practically room temperature; when it's at its highest, you can almost "fry an egg"!
I think that as soon as Apple recognizes that there is a problem with these computers, the first thing it will do is make a change to the OS that reduces the maximum brightness limit allowed (to less than 500 nits). Time will tell...
Why does this happen?
For at least one of three reasons:
1- a design flaw - so this problem is likely to occur in a large number of devices;
2- a defect in components - the problem is limited to a few cases;
3- use of components below Apple's standards - the problem may be limited, or more widespread.
This was the explanation I was given. I'm not a technician. Only Apple will know the exact reason(s).
If I had to guess, I'd say that I don't believe it's a design fault, because Apple has an obligation to be very careful about that; I also don't think it's a fault with the component(s) because it seems to be happening all over the planet and doesn't seem to be localized; so I think it's due to the use of component(s) below, or at the limit of, Apple's standards which, when put under extreme stress (higher brightness), end up failing.
I think it's already clear to everyone that this is a design or manufacturing defect in this Apple model.
So let's hope that Apple takes on this construction problem and repairs it or at least contributes part of the cost of the (overly expensive) repair of our computers.
If it were a car, surely all our computers would be called into the workshop to replace the component that has broken down or is in the process of breaking down.
As it's a computer... let's hope that Apple will behave in a way that suits its customers, who believe in the above-average Apple standard...
So keep presenting your cases to Apple.