It’s basically a self-hosted stream that moonlight connects to within your network. https://github.com/LizardByte/Sunshine/releases You still need any and all software that’ll actually be running on the server, but you can use sunshine either for streaming particular applications from it or just as a general all purpose remote access tool. So it’s like Parsec, only FOSS and imo works better too.
See if just opening the task manager and leaving it open also keeps the pc from freezing. If so - that points towards a malware.
Additionally you can set up a monitoring software to get the load readouts on your phone and see if maybe something weird is going on when the pc should be idle (like 100% cpu load or disk usage). Pitikapp + hwinfo is a free combination for such setup.
Does the keyboard numlock button change state when the pc is frozen (led turning on and off when you press it)?