Did you disassemble the upper or lower when you swapped barrels or did you just separate them, swap barrels, and reassemble? When you say single shot, what exactly do you mean? Does it fire, eject, chamber a new round, but the trigger just doesn't reset? Or does it fire, eject, and then lock the slide back as if the gun were empty, even though the mag may still have rounds in it? Or, other???
I know this will sound silly to some/many, but did you do a proper function check on the gun before you shot it to see if it was, well, functional before and/or after your "mods"?
Unless you are ham fisted and you literally destroy things when taking them apart and putting them back together, there should be no reason for a barrel swap to cause a Glock to malf (unless the barrel is so far off in spec it doesn't work or you damaged something in the removal/installation process). If the gun is malfing with both the aftermarket and stock barrels, it seems like something must have been damaged during the swap or the gun never worked properly to begin with.
I would take the slide off and examine it and the frame/trigger for obvious defects/issues (maybe post a pic or two here for the experts to look at) and then reassemble with the stock barrel and perform a function check to see whether it passes or not... If it does not pass 100% every time, then you have an issue that you should correct before loading it up and moving to live fire tests and hope the issue will just rectify itself... just my 2 cents...