I agree it shouldn't be said without knowing the context of people's lives - the tragic truth is that there are some people who don't have anyone that cares about them in their lives.
But, I'd say this is probably somewhat rare - I imagine most people have at least someone in their lives that does care about them, and who would be hurt by their loss. Again, not denying this isn't the case for everyone.
It does sound very much like a platitude, but I think as with most platitudes … they're often well intentioned, and there is usually some shred of truth in them. Mental illness can warp our perception of things, make us believe people don't care and they'd be better off without us. This usually isn't the case, and although just being told 'people care' doesn't fix things, it doesn't mean it's not true either, and I think there is probably something in it to think about.