I don’t like your re-raise. Its an unknown player, you have little information, so I don’t see how you can re-raise here. I think a call would be a better play. Also, when you raise to $40 and he shoves for $360. That just doesn’t make any sense at all. Likely you are facing JJ or QQ, given your blockers, AA & KK are less likely. But sometimes bad players love to over shove those premium hands in fear of losing. They love to throw away value.
Bottom line for me, treat new players as tight players until information provides otherwise… therefore if tight player raises, I’m only calling with AK off. Probably just calling with AK suited as well. Either way, it seems like you got away with the weaker hand and simply saved value.