Though the crew treated badly, I do find it assuring that Captain Picard chose to keep Lt. Barclay on his ship rather than transfer him to another ship, which carried with it the implication that Captain Gleason had done just that thing. I would think this might have an influence on how the lieutenant views himself knowing that one crew has rejected him.
And, I like it that Geordi LaForge and Deanna Troi kept in touch with him after he had left the Enterprise
. I feel Voyager did right with Barclay.
I don't think it's possible to diagnose Barclay's condition. From what I have seen, in movies and tv shows, the people who write scripts are for the most part ignorant of mental disabilities and mental illnesses. When they do reveal knowledge of these two, it comes off as superficial and flawed.