I have the exact same issue. My rig is:
CPU: AMD Ryzen 5900X
MB: ASUS ROG Crosshair VIII Hero (Wi-Fi)
RAM: G-Skill Ripjaws 4000MHz, CL18
Whenever I use the D.O.C.P it does the exact same thing as yours. What I did to fix mine (temporary solution, but It'll do the trick if you want to use your PC while waiting for a better answer) I loaded the D.O.C.P which is 4000MHz CL18, and a whole bunch of stuff that I don't have the first clue what they mean. Then I lowered the Memory frequency from 4000MHz to 3800MHz and the FCLK frequency from 2000MHz to 1900MHz.