Job 3:16
14 with kings and counselors of the earth who built for themselves places now desolate, 15 or with princes who possessed gold, who filled their palaces with silver. 16 Or why was I not buried like a stillborn infant, like infants who have never seen the light? 17 There the wicked cease from turmoil, and there the weary are at rest. 18 There the prisoners relax together; they do not hear the voice of the oppressor.
Ecclesiastes 6:3
1 Here is another misfortune that I have seen on earth, and it weighs heavily on people: 2 God gives a man riches, property, and wealth so that he lacks nothing that his heart desires, yet God does not enable him to enjoy the fruit of his labor—instead, someone else enjoys it! This is fruitless and a grave misfortune. 3 Even if a man fathers a hundred children and lives many years, even if he lives a long, long time, but cannot enjoy his prosperity—even if he were to live forever—I would say, “A stillborn child is better off than he is.” 4 Though the stillborn child came into the world for no reason and departed into darkness, though its name is shrouded in darkness, 5 though it never saw the light of day nor knew anything, yet it has more rest than that man—
Notes and References
"... Qoheleth describes the acquisition, loss, and (non-)enjoyment of wealth as directly dependent on God (see 5:17–6:2). Although not using the language of blessing, Ecclesiastes 5:18 does call wealth, possessions, and their enjoyment “the gift of God”. Thus, despite the apparent divergence there is actually a striking agreement between Job and Ecclesiastes with regard to this topic, as presented in these two texts, and the close verbal correspondence between Job 1:21 and 5:14 invites the reader to consider them together ... A second verbal parallel cited by Dhorme also refers to birth but, in this case, to a stillborn child (Job 3:16; Ecclesiastes 6:3-5) ... The most significant verbal link between these two texts is the use of the rare word for “stillborn,” which occurs elsewhere in the Hebrew Bible only in Psalm 58:9. Psalm 58:9 is an isolated clause - “like the untimely birth that never sees the sun”, the only other text in the Hebrew Bible which uses the verb to express “seeing the sun / light.” The expression “to see [the] sun” using the Hebrew verb, as in Ecclesiastes 6:5, occurs in Deuteronomy 4:19 and elsewhere in Ecclesiastes 7:11 and 11:7. The expression “to see light” is more common in BH, occurring eight times (Genesis 1:4; Job 3:16; 31:26; 33:28; 37:21; Psalm 36:9; 49:20; Isaiah 9:1). It is interesting to note that the one expression is favored in Ecclesiastes (which also reminds one of its repeated use of “under the sun,” 27×) while the other is preferred by Job ..."
Schultz, Richard L. "Job and Ecclesiastes: Intertextuality and a Protesting Pair" in Dell, Katharine Julia, and Will Kynes (eds.) Reading Job Intertextually (pp. 190-203) Bloomsbury T&T Clark, 2013