You understand that action was still about to get him killed if not for Shanks, and that's the entire reason he was crying with snot running down his face while saying that?
It's still a big crime for him to stop Akainu in his tracks and monologue to him about why he should stop fighting. It's not physically fighting since he obviously can't do shit to Akainu but either way it's a crime in their eyes.