Well, first thing, check if the artifact exists on an external screen. This will help point to whether or not the problem arises from the screen/cable or gpu. It looks like cable issues with your model are somewhat common with folks popping their imacs open for upgrades, repairs etc. .
My iMac succumbed to a faulty GPU which was very common for the a112 model. Initially I gave it a lease on additional life with a reflow in the oven, new thermal grease & pads alongside SMC fan control. After this tune up of sorts I got a couple extra years of life however ultimately it did fail completely. I replaced it with another gpu and the iMac is rock solid. It currently lives in its box in the closet. I’d love to pull it out again but don’t really have a space for it ATM.