Without looking the script it's hard to say what's wrong. But sounds like you just want to do a transfer.
incoming leg (1) connected to outgoing leg(2), now you want to drop leg(2) and connect leg(1) to leg(3), something like that.
The key is that leg(1) and leg(2) is connected. You need to use "connection destroy con_all" to break the connection then you can use "leg diconnect" to drop whatever leg you like to drop then setup call to the new destination
You can go to http://www.cisco.com/cgi-bin/tablebuild.pl/tclware look for the script. This script is complex you just need to liik for how to use "connection destroy"
app-h450-transfer.2.0.0.10.zip