Local-shell completes execution but packer is not moving to the next provisioner

We run packer on 1 ec2 instance which we call the deploy instance; to build amis in multiple regions. The build comprises of 12 tasks and each of these 12 tasks complete ok when the region is identical to the region where the deploy instance is hosted.
When the region is different, packer doesn’t proceed from Task 11 to Task 12.
Task 11 is a local-shell where a script is called to perform Capistrano builds on the target instance. The script debug logs shows that the Capistrano build completes ok and the script exits with 0 return code. However Packer doesn’t proceed to Step 12.
After trial and error, we noticed that Packer proceeds to the next step when the ec2 instance is rebooted.
So as a workaround, we are now placing a aws ec2 reboot command in the Task 11 script.
Why is Packer assuming that the builds are still in progress in Task 11?
OS: Ubuntu 14.0.4
Packer: 1.9.0

This problem doesn’t seem to occur when packer connects directly ; instead of going via the bastion.