OP wrote:
"It may be the non genuine hdmi adapter..."
I sense the core of the problem may be here, in the connection.
If you have displayport on the monitor, use that instead.
You need a "USB-c to displayport" cable.
IMPORTANT:
BE SURE that BEFORE you buy, you carefully read the reviews to ascertain that the cable you're buying is "known to work" with a 2017 iMac.
SOME USb-c to displayport cables work with pre-2017 Macs, but DO NOT WORK properly with 2017 and later Macs.
Again, you must exercise your due diligence and check this out before buying!
If that doesn't work...
I'd consider going back to High Sierra for now...