It might be an inactive ingredient in the specific syrup you're taking that is giving you the trouble. Remember to make sure that it has ONLY dextromethorphan as the active ingredient! You could try to extract the dextromethorphan from the bottle using the Agent Lemon method. A stomach ache is understandable since you are, in fact, drinking cough syrup.

Keep safe