As you mentioned child has hard stool usually, so constipation might be the reason for on and off stomach pain. Iron itself causes gastritis n might increase the stomach pain. Try to increase fibre content in the diet and enough of water daily. If eating banana give ripe and yellow banana.
Next Steps
Kindly increase water and fibre content of diet. Do deworming every 6 monthly