Get the accelerator cable replaced, this used to happen to my swift as well. It started happening alot during winters here and would go away after I pressed the pedal 3-4 times whenever the rpm shot up between gear changes. I searched this issue online and on this forum as well and decided to replace my car's accelerator cable.
When my mechanic removed the old cable, there was a small break in it which caused it to get stuck in the plastic insulation of the cable. The break was on end of the cable where it forms an elbow and connects to the throttle body behind the filter housing. I got an aftermarket cable last week for 1,150 in Lahore. I have driven to Islamabad, Murree, Ayubia, Nathiagali on a 3 day family trip, since friday and came back this evening. No problems with the accelerator getting stuck now Alhamdulillah.
I would recommend you get the cable replaced as soon as possible. or ask your mechanic to remove the end of the cable that is connected to the throttle body and pull the inner wire, you will see the break in the cable. It usually happens at the elbow.