A series on the book of Ecclesiastes came out in 'my' denominational monthly magazine, and in November 2018 it dealt with chapter 4 verses 1-6. First, some introductory points might be worth making.
The Teacher is challenging readers to face up to the harsh realities of life "under the sun". That is to say, without breaking through to heaven and finding spiritual realities; just living as a human, struggling and tired, in a material world. The acronym FINE is a theme, for it addressed people who are...
The modern world is no different to the Teacher's world in those respects! He burns at the injustices and wrongs in life. He mourns the passing of youth and the inevitability of death, but he keeps searching for something more and, by chapter 12, he's found it. Therefore, no part of Ecclesiastes should be read without reading "the conclusion of the matter" at the end of chapter 12.
So, chapter 4 - it starts by dealing with oppression - tears and no comfort for the oppressed. Solomon, the Teacher, observes that the misery of the oppressed can be such that it would seem better for them had they never been born. Evil work "under the sun" (vs. 3) is truly horrific, and we have a massive amount of modern-day examples of that. The awful increase in suicides, and attempted suicides, and mental breakdowns testifies to this. The true horror today is that younger and younger people are falling into this pit of despair, due to oppression. Even primary-school children are now receiving psychiatric medication and psychological counseling. Child abuse is on the rise, as public child sex abuse enquiries have proven beyond a shadow of any doubt. They are uncovering horrendous abuse from the mid 1900s till today, with the perpetrators being in total denial. Those they abused (if they didn't commit suicide) have had most of their adult lives wrecked. They would probably agree utterly with Ecclesiastes 4:1-4.
You also mentioned Ecclesiastes 6:3 (covered in the April 2019 edition). It starts by considering the plight of a wealthy man in high position, but who cannot eat. That is an evil disease. So what good is it to live into old age and have 100 children, yet there is no good in his life and no burial at the end of it? Vanity and darkness is his portion, even "under the sun".
However, when a breakthrough is made, to spiritual realities, perspective changes. "Under the sun" means blazing, unrelenting, unbearable heat. But break through into God's domain - heaven - and everything both looks different, and is experienced differently. There is life beyond the grave. There is forgiveness, healing, peace and joy once fellowship with God is experienced. It is such that even torture and death cannot rob that child of God from all of that. They know that they have passed over from death to life the moment they truly believed, and nothing in all creation can now separate them from the love of God that is in Christ.
That was barely hinted at by the Teacher, for Christ had not yet come. This means we dare not take the book of Ecclesiastes on its own. It must be set in context of the times, and the limited revelation of God. But once the promised Messiah came, everything changed. Conclusion: In Ecclesiastes, the Teacher was speaking generally, and not specifically saying everyone would be better off dead. He was identifying those suffering in those particular ways as (understandably) thinking they would have been better off had they never lived.
The articles I refer to were published in The Record (Free Church of Scotland). But apparently they were first published in Christianity Today magazine. And this link might get you into some on-line articles: