This must be very confusing and difficult. Without talking with him, I can’t be very helpful. My only guess is this: Sometimes, something traumatic happens to people that makes them reevaluate all their ideas about themselves, their relationships and life in general. Sadly, they often come to the conclusion that no one can be trusted and that they are on their own. The traumatic experience was so overwhelming and painful that their approach to life becomes defensive and negative. I have no idea if this applies to your son, but it would be my starting point if someone who came to me for therapy presented what you described.
If you can ask your son gently and sympathetically what happened three years ago, he might even tell you. Sometimes it’s a relief to someone like him to be asked if it is done in a heartfelt and supportive way. Let him know how much it hurts you to see him hurting and separating from the people who love him. And let him know that you will love him and be there for him whenever he feels he can confide in you. Encourage him to think about getting some therapy. Continue to love him and show it regardless of how he is behaving now. You didn’t raise a cold-hearted son. Hopefully, with time and your on-going love and support, he’ll come back to himself.
I wish you well.