There are many ways in which this is true.
First, gross domestic product (GDP) on its own does not measure how rich a country is on a per capita basis. For this reason, for example, GDP is not a good measure of how well-off China is. China has the second biggest GDP in the world, but its GDP per capita is quite low. This means the average Chinese person does not have a high standard of living compared to people in other countries.
Second, GDP does not measure income distribution. You could have a country with a high GDP but where there was a huge gap between rich and poor. This country might not have the same level of social welfare and stability as a country with a lower, but more evenly distributed, GDP.
Finally, GDP does not measure quality of life. GDP only measures paid economic output. Imagine that there is one country in which both parents in a family typically work and another in which a parent stays home with the kids. The first country would have a higher GDP because more people would work and there would even have to be paid childcare (which counts in GDP). In the second country, there would be fewer workers and the childcare, cooking, cleaning, and other services provided by the stay-at-home spouse would not count as part of GDP. But the quality of life might be better in the second country as people had stronger families and less stress. As another example, a country in which people work 45 or 50 hours a week might have a higher GDP than one where people work 35 hours and have more leisure time. But it could be that the country with the lower GDP would have happier people and greater social welfare.
For these reasons, GDP is not a great indicator of societal welfare.