You probably used Nvidia and some outdated distro with a bad DE on top. Not something you should be using. Using X11 is DOA anyway, so you can figure out what was wrong in your case and use better options.
With AMD, always make sure to use latest kernel, Mesa and amdgpu firmware.
But then there was a strange glitch on every single game (both native and Proton-based). Periodically (e.g. every ~10 seconds on some 3D games, on every screen reload on some other) the screen turned black for about 2 seconds.
Then I remembered that I had some issue when I first installed Debian 12 two years, though I forgot which issues exactly, and that I solved them by switching from Wayland to X11.
I'll try updating the firmware and drivers manually if I have more issues in the future, thanks.