How do I get Hogwarts Legacy to stop lagging and crashing?

I played this game when it first came out and I always had a lot of issues with freezes and random crashes. They happened at really random moments too. Sometimes it was from running too fast, or just from opening the in‑game map. It was really weird and happened a lot. In my view, it was because the game was so new – optimizations still had to be made, etc. And my PC wasn’t good at the time either. I had 8 GB of RAM and a GTX 1660 Super.

So, I ended up uninstalling the game and decided to test it again this week, years after release, debuting my new PC setup: 32 GB of RAM and a 4080, game installed on an NVMe M.2.

And the verdict is: no difference at all with crashes and stuttering so far. The game still has lots of issues. I looked up several tutorials on the internet and none of them worked. I turned off RTX, lowered graphics, tweaked Windows power mode, disabled hardware‑accelerated GPU scheduling, turned on Windows “Game Mode”, and nothing! The game still stutters several times each match. I have no idea what else it could be. Both GPU and CPU temperatures stay normal. My case has excellent airflow. I’m using a Corsair 360 AIO water cooler. The thermal paste on both the GPU and CPU was replaced recently.

I’ve already cleared the cache in the game folder several times.

I’ve tested the game through Xbox Game Pass and on Steam. I don’t know if this game just runs better on console?