Two different internal SSD drives pass hardware tests, but attempts to re-install Windows on them fail during the initial disk partitioning and formatting options, with a low-level error and a very long delay.
The particular machine type model is 20CDCT01WW, the initial OS was Windows 8 Pro, later updated to Windows 10, and it's now out of warranty. It crashed one day during normal use, not near the time of any major hardware or software changes, and hung during re-booting. Attempts to recover the Windows installation failed, so we tried re-installing Windows from external media, and this process took far too long (running overnight, before finally failing with low-level error messages). I assumed the drive was faulty (the original Lenovo-installed Samsung PM851 128GB SSD), and by using Windows 10 recovery options from external media we could run the DiskPart utility & not have it find any partitions. I installed another, a new 500GB Samsung 850 EVO, only to have it behave in an identical way (the initial partitioning step of a new Windows install would run for hours, then fail with messages such as “We couldn't install Windows in the location you chose. Please check your media drive. Here's more info about what happened: 0x80070057.” Meanwhile we re-checked the original drive on another machine via a SATA to USB converter & saw an apparantly intact filesystem, so it didn't seem to be seriously faulty after all.
The built-in hardware diagnostics don't detect any problems with either drive installed. Obviously there's no way to run the standard Lenovo Windows-based diagnostics, but the Linux-based bootable diagnostic disk image from Lenovo didn't report anything. A test installation of Linux seemed to work, but was reporting that the SATA interface was not running at the full 6Gbps (unfortunately I don't have a before & after comparison with Linux to determine if this was always the case). Re-partitioning the new disk on another UEFI-aware system before trying the installation didn't make a difference. The firmware has been re-flashed to UEFI BIOS Version GQET52WW (1.32), 2017-05-04. We've tried various configuration settings, including reverting to the defaults. We've varied the USB ports to which the external media for the re-install were attached, and tried different media. When changing drives, I checked that there were no obvious problems with the SATA connector & that the drive was properly seated.
Could there be a subtle problem with disk controllers, cabling, or firmware settings that would cause it to pass the hardware tests but still fail a Windows installation?