Series X shuts down when trying to play games

I wonder if you guys may be able to help me.
I have had my series X since launch, it worked flawlessly until about 2 months ago.
Now when I play games it will randomly shut off, sometimes I get 30 seconds, sometimes 30 mins (mostly closer to the short end).
The machine can be on youtube all day without issues, or remain on for hours downloading (as had to do when did a full factory reset), but as soon as I try playing games (mainly Forza Horizon 5, Destiny 2) it shuts off completely.
I don’t get any error messages when the machine is switched back on and I can switch it on again straight away.

With only the 1 years warranty, and the fact MS want £254 for an out of warranty repair I figured I would ask here if anyone has had the same issues and what it was that needed repaired.

The inside of the Xbox is clean, I have opened it after this began happening thinking it may have been dust - I opened, removed fan and cleaned it, but not gone any further than that.
I had contemplated seeing if thermal paste needed replaced but struggled couldnt get the base off (maybe didn’t have correct tool) so decided would check here before possibly running to MS with my tail between my legs.

Many thanks,

overheating. replace thermal paste

I don’t think that it’s an overheating issue. Mine does this as well and I’ve already replaced the thermal paste.Also replaced the ssd thinking that it may have been corrupted since it used to crash during boot up most of the time. I think it may be something on the hdmi circuit. Possibly the retimer. Also at times mine will flicker before it shuts down. Have you noticed any flickering?