So you removed the content database from the second web app,
And then you removed the original from the first web app, then restored it back
to the first web app right?
Your then trying to do a STSADM restore of the site collection to a "Different
URL", the url in the second web app correct?
If that is correct, and you're still getting the error, I know in V2, there
was a databaserepair operation for STSADM for orphaned entries in the database,
don't know if it's in V3 though, but you might want to check and run that to
ensure that it's cleaned back up.
Restoring the content database into the farm before removing it from the first
web app may have created some orphans when you later removed it