@chatainsim I couldn't see strange things in your sketch. What I always do when I build a multi sensor node is put a small wait after each message I send to the gateway. I've noticed that the radio cannot always keep up with the speed of the Arduino. So something like gw.wait(15); after each gw.send does the trick for me.
These are the though ones to pin point. Because it's 80% for sure a power related issue.
If you happen to have a buck converter, you could try to set that to 3.3V. Power it from an adapter and feed the Gateway antenna from the buck converter. Don't forget to connect the grounds of the radio and the Arduino.
But it's really hard to help you from a distance. Maybe someone else has some ideas.