If loneliness causes poor health habits, a machine that cures poor health habits would be an exquisite device for psychological torture - removing the possibility of death while preserving all the yearning for it. Asimov wrote a story once about that -- a selfish and suffering God who tortured brilliant souls by giving them eternal life so they would help God in God's quest for a method of suicide that would kill an immortal.
And in the context of the story, would it not be plausible that they would acclimate to being isolated from their peers? There is precedent. In WW2 there were Japanese soldiers that remained fighting their war for decades after Japan surrendered, cut off from anyone that they could feasible interact with as they still believed they were deep in enemy territory, coming out only when their commanding officer relieved them of duty.