I am currently have this same issue. I have updated BIOS and drivers. I have manually configured the fan to full speed and this happens on any game, not just 1. It varies on time meaning I can play for 20 min or maybe get an hour before it occurs and I have tried HDMI & DP cables. The music is still playing when I lose input signal and it never comes back until I reboot the pc. This pc is 8 months old and this started happening in the last 2 months.
System:
Windows 10 v1909
Intel Core i7-9700KF @ 3.60GHz (no overclocking)
ASUS Prime Z390-P ATX motherboard
240GB SSD
16GB DDR4/3000MHz
Monitor:
MSi Optix MAG341CQ