I tried everything to solve the colored squares problem on an old imac, but had to finally give up and buy a new mac mini m1.
I stored the imac with the colored squares problem in the attic which gets fairly hot in the summer.
But, i had to bring the old imac down from the attic since our version of quick books would not run on recent macs,
but would run on the old imac.
Not only did quick books run, but, miraculously, 6 months storage in the hot attic completely solved the color squares problem, so far permanently!