hm thats strange. i dont see anything glaringly obvious. I see it fails to execute the command “configure terminal”. What version of IOS are you running against? Is AAA involved? Can you replicate the steps manually when logged via the same user/password combination?