Trying too hard to be perfect often means you begin to live as someone you aren't. So even connections with others, are connections with your "fake self" (consider the imposter syndrome).
So loneliness persists, because "no one is friends with the real me".