Why is my guy friend mean to me out of nowhere?

We’ve always had a complicated friendship. He’s always been friendly and he also flirts with me. Anything from holding my hand, telling me we should go out sometime, telling me he actually thinks I’m cute, etc. He’s also told me we’ll never be close friends, which I don get.

In the fall we planned on going out for drinks. He was really excited and started texting even friendlier. He told me I don’t need to worry so much. Then it was like a flip switched in the span of three days. He didn’t want to talk, wanted to be left alone for awhile, we never made plans, and he told me I confuse him. I asked him how so and he said he wasn’t having that conversation with me. I asked him what I did to him to have him treat me like that and he said in his eyes there’s no tension or dislike from his side. I don’t get it, why did he suddenly get mean?

Updates
1 y
When I asked him out for drinks he was all excited but said he had to get some work done on his house. He told me we'd have to make something work, though. I took that as it would never happen and was confused why he even accepted in the first place. I told him we didn't have to go out and he could say no if he wasn't feeling it. Then he got weird and when he finally answered he was just angry. I told him it feels like he dislikes or hates me and he said he doesn't at all. Why did he flip out?
Updates
1 y
Looking for male perspective, as I'm curious what could've possibly changed that quick?
Why is my guy friend mean to me out of nowhere?
Post Opinion