What Solomon presents as an advantage seems to have little to commend it. The stillborn child comes into this world of vanity and raises no expectation of future prospects but is counted as a life that never really got started.
How vain life must be, if it is better never to have grappled with it, in the deluded belief that there is something real to be gained from life without God. You engage with life with all the enthusiasm of a runner setting out to win a race. But you are doomed to fail before you start and all the energy and optimism you put into it will be ground down by the vanity of life, leaving you with nothing at the end. What begins well will end badly. Better like the untimely birth to have left before you began. If this child who departs in darkness, is better off, then the man who lives what seems like a full life also departs in darkness, and so he does, for he goes to the place from which there is no return.