Get your ram stable first, memtest64 works alright and should find any immediate stability issues, then play with the curve optimizer. 2400mhz is a bit low for a 5900x, but if its the only way its stable, probably wont have much choice.what kit of ram is it anyway?
My 5900x, 1 of the best cores does not like more than -10, the other best core on the other CCX will only do -15, every single other core will do -25 and -30, Im still playing with it.
How I do it, say you for -10 stable on all cores, do per core and I do 2 or 3 cores at a time, drop 2 or 3 cores to -15, I personally wait a week of just using my computer normally to see if its stable, once that week passes, I pick 2 or 3 other cores and go down to -15 and repeat. It does take a while with 12 cores lol.
Every chip is different so I wouldn't try to set you curve to match another users 5900x, chances it wont work.
From my experience the Curve optimizer, if you go to low, I had issues with it randomly restarting when its at idle, full load always worked.
A real undervolt would be to play with the EDC, TDC and PPT, but you would limit the performance of the chip where Curve Optimizer can actully increse the multi core performance, It doesn't necessarily undervolt, it just moves the curve of the max voltage a core can use at a clock speed.