Setting RAM to 4000 Mhz implies your Fclock can run at 2000. That is the case on only 10% or so of 5000-series CPUs. Mobo is probably setting Fclock and Uclock to lower values. This tanks performance, you want a 1:1:1 ratio. Check with Zentimings.
https://zentimings.protonrom.com You want those 3 values, Mclk, Fclk and Uclk to be the same.
3600 Mhz RAM is guaranteed to work, 3800 Mhz works for many. So try running one of those speeds.