His behaviour was defo weird. He shouldn't be shouting or cussing at you just for that. After all, he did say yes at first. Though it may be worth finding out if he's having any problems or anything and if so, then helping him. When people are stressed, they usually vent out someone's frustration on someone else. Just give him some time and then go speak to him calmly but make it clear that he made you feel bad and if he has a problem he can talk to you about it anytime rather than hide it.