I had a similar experience with a WD Black SN850. Basically it would not train at gen4 speed, usually coming up at a degraded speed but sometimes not coming up at all. I tried replacing the M2 --> PCIe adapter but to no avail, and eventually bought another NVMe (Seagate FireCuda) which works fine.
The WD Black drive is now in an older system that only supports up to PCIe gen2 and seems to be working reliably, but obviously I'm not trusting it with anything important.