I had a hunch it might of been the motherboard given the name brand, especially since we ruled out the ram.
With Gygabyte having a terrible reputation lately for exploding PSUs and using cheap parts on budget products (but do their best to at least make them look good)... it makes sense that a pre-built system with the cheapest parts would result in possible issues like this.
Best solution is to replace the motherboard with a different name brand motherboard (Asus or MSI are usually pretty good). Just make sure all the other parts are compatible with it.
Quick fix, more case fans... drill some holes if the front panel is stupidly made in a way that blocks airflow. If it's all glass, then well, remove that glass I guess.
Dice roll fix, it's possible it could be as simple as bad thermal paste on the hot component where the heatsink is placed on. If no heatsink, then buy one, if thermal paste is applied, you could try to find a larger compatible heatsink to replace it with. This solution could be quite the hassle though.
Keep in mind that just keeping the temps low enough to prevent it from crashing doesn't mean damage couldn't still happen long term. Try to find a way to dramatically lower that temperature so as to not have to revisit this issue again in the future.