One possible reason could be that he was poisoned. In the wizarding world, there are many dark spells and potions that could cause such a reaction. Another reason might be extreme motion sickness if he was on a wild magical ride, like on a particularly unruly broomstick or a flying magical creature.
Well, perhaps he ate something bad. In the wizarding world, there could be all sorts of strange magical foods that might not agree with his stomach. Maybe he had a bad reaction to some experimental potion he drank. Or, if he was in a battle, he could have been affected by a dark spell that not only injured him but also made him vomit as a side - effect. Also, if he was under a lot of stress, it could cause his body to react in such a way. For example, if he was worried about the safety of his friends or family during a dangerous time.
In a 'James Potter vomiting fanfiction' plot, there are several potential reasons. He could be suffering from a magical illness. Wizards can get sick just like Muggles, and some magical diseases might have vomiting as a symptom. He might also have overexerted himself magically. If he used too much magic in a short period, it could take a toll on his body and lead to nausea and vomiting. Another possibility is that he was in a situation where he was extremely frightened. Fear can cause the body to have a physical reaction, and vomiting could be one of them.
Chapter 126, "The Production Team Actually Played Dirty on This?!", is the clearest early answer because it turns Sister Li's situation into a concrete plot event. The chapter gives readers a real answer by opening on Wen Jiaojiao initially wanted to cause trouble.
Chapter 302, "Did You Just Stomp on the Answer Sheet Twice Before Handing It In?", is the clearest early answer because it turns Qu Theory's situation into a concrete plot event.
Chapter 72, "Jiang Li Resembles an Early Capitalist", is the clearest early answer because it turns Movie Emperor's situation into a concrete plot event. It opens with Jiang Yan was still griping when suddenly a fair hand reached out... and closes on Think about it." Jiang Yan fell silent..
Chapter 422, "The Watch Was a Gift from Him", is the clearest early answer because it turns Nina's situation into a concrete plot event. It opens with Seeing that no voice came from the watch to stop them, the captain of...
Chapter 365, "Are You Sick?", is the clearest early answer because it turns Brother Shaojing's situation into a concrete plot event. The chapter turns that into something concrete by moving from Jiang Li didn't make a sound, she merely glanced in the direction of...
Chapter 40, "The National Museum Speaks!", is the clearest early answer because it turns Wen Jiaojiao's situation into a concrete plot event. It opens with [Jiang Li claims she copied this herself? and closes on The handsome guys on this show are so difficult to deal with..
Chapter 397, "Talent Show Program", is the clearest early answer because it turns Jiang Shixu's situation into a concrete plot event. The chapter gives readers a real answer by opening on Second Aunt, I know you're worried about Shixu interacting with...
Chapter 428, "Stunning Debut!", is the clearest early answer because it turns Especially Xiao Yi's situation into a concrete plot event. The chapter gives readers a real answer by opening on I'm going to perform a cover of the song 'The Ocean'..." Jiang Shixu...
Chapter 321, ""Great Benefactor" is Jiang Li?!", is the clearest early answer because it turns Zhang's situation into a concrete plot event. The chapter gives readers a real answer by opening on Several people thus settled down in the living room, and the servants...
Chapter 210, "Are All of Jiang Li's Fans Hidden Big Shots?", is the clearest early answer because it turns Shang Shaojing's situation into a concrete plot event. A useful checkpoint is the way the scene starts with This was Zhao Lang's first public appearance.