Something odd occurs when running consecutive self-tests on Windows OS. The second self-test fails if started within 10 minutes of the first self-test. The second self-test fails with error code 31 but the NVMe log indicates the second self-test was NOT run. Therefore, it appears the failure occurs in the driver before the self-test was started on the NVMe drive.
This behavior has not been observed in Linux or WinPE. This behavior occurs between self-tests of the same or different types: short or extended.
The workaround is to wait at least 10 minutes between self-tests.
A typical example for how this may show up in the field. An NVMe owner suspects their drive has an issue so runs the short self-test. Assuming the short self-test passes, the owner is likely to immediately run the extended self-test for a more thorough check. The extended test would fail indicating the NVMe drive has an issue when it does not.