Mate, many thanks for trying to replicate/test and help out on this! Much appreciated, I own you a beer just for trying.
I was actually able to fix this believe it or nor…
One of the KDE devs replied to the BUG and pointed it could be a gamescope issue to try to disable HDR in gamescope and run the game.
He has right, even if HDR is disabled the flickering is still present. This pointed me to proper direction and I found an issue opened on the official gamescope repo.
Which after reading looks like gamescope can introduce VRR flicker due to nesting. I turned on my monitor’s built-in refresh rate OSD, and per it the Frame rates were all over the place even tho in game they were stable 90.
However matte-schwartz pointed out one interesting parameter --adaptive-sync
I checked the gamescope help
–adaptive-sync Enable adaptive sync if available (variable rate refresh)
I set the parameter: gamescope -w 3440 -h 1440 -f -r 165 --adaptive-sync --hdr-enabled -- %command%
= No flicker
I tried as well same parameter with using gooverlay: gamescope -w 3440 -h 1440 -f -r 165 --adaptive-sync --hdr-enabled -- %command%
= No flicker
I tried as well to set mangoapp as a parameter gamescope -w 3440 -h 1440 -f -r 165 --adaptive-sync --hdr-enabled --mangoapp -- %command%
= No flicker
And the flickering is gone. So looks like in my case this was a user mistake. If gamescope is used with a VRR monitor e.g Adaptive sync is turned on, gamescope has to have this parameter explicitly set otherwise VRR is broken and causes insane flicker bellow 100FPS.