This might be related to your problem. See more information at this [link][1]. Basically Salesforce has a bug in terms of pulling down the connected app from live when you do a refresh. It might explain the second problem you have experienced and it might solve the first problem with the failure to log in. Maybe creating a different connected app with a different name in the sandbox and then change the login details and the name of the connected app in your third party app. See if it logs in every time, hope it helps


  [1]: http://salesforce.stackexchange.com/questions/45890/unable-to-create-a-connected-app-the-application-name-has-been-used-before-ev