One possibility: Fuel pressure leaking back in to tank.
Fuel systems have check valves that let the fuel travel one way, to the engine, and prevent it from flowing back into the tank when the engine is shut off. If the valve fails, there is no longer any pressure in the line, and it takes 2-6 seconds for pressure to build to the minimum for the injector to function properly. Long enough for most to give up and stop cranking.
This can be confirmed with a fuel pressure tester on the fuel line after the pump. Run the car, verify pressure, then shut off. It will settle a little, but should not move at all for at least 24 hours. A car should hold nearly full pressure several days minimum, some will hold for weeks. If it drops off even 1/2 way, it will lead to hard starts. Most cars that I've seen this in leaked down over about 6 hours, so a trip to the store, it still had enough pressure to start in the parking lot, but overnight it was all leaked down.
You can confirm this by getting it to start and run successfully and then shutting down immediately after you confirm its running right, leaving everything still still stone cold. If it then starts back up perfectly on first crank, you know it was fuel pressure leak down.
On older cars with keyed ignitions, the simple work around was to put the key to "on" but not start the car. This would cause the pump to "prime" in anticipation of a start. If you waited 2-6 seconds and then tried to start, it was up to pressure by then and started fine. Others required you to also step on the brake, or to turn past "on" but just before "start" to initiate the prime. You could hear the pump in older cars with little sound deadening so you know what to do. I have No idea how to prime the system in these cars, and it may not even be possible, requiring repairs of the faulty valve.