Please describe: Program does not work correctly. What does the program do and what does it not do? I do not have a GSM module, I cannot test it in real life.
Why do you actually use Softserial when you leave the hardware serial pins of the Atmega free? Ok you could of course connect a USB - TTL serial converter to the hardware serial pins (ONLY RX, TX, and GND!) And insert outputs into your program and have them made on the serial monitor of the Arduino IDE, then you can see where the program is hanging and what exactly it does after the reconnect. Whether it starts at all and how far it gets before it doesn't work anymore. These are things I can't see from here. I could only give you advice about the hardware, referring to the manufacturer's applications and my more than 40 years of electronics experience.