Please put formatted code inside [code] and [/code] tags so it can be easily read and analyzed. I spent more time trying to work out whether your braces were correct and then reformatting your post than I should have, resulting in having less time to actually look at your problem.
A couple of quick thoughts -
You are expecting "aassword" - is this correct? The
word Password normally only has a single "a", so I would not have expected your script to ever work.
I think that the problem is likely to be with the fact that you have nothing after the sending of the password - you just allow the expect command to return. So sometimes the timing will be right and you will have an instantaneous login on the remote box that will be immediately dropped, and sometimes expect will complete before you see the output.
So 2 possibilities:
Try putting an "interact" as the line after the "send password\r" - that will allow you to see what happens next, and allow you to use the connection you just made.
-or-
Try putting 'expect "Last login"' (or whatever text your login should provide) following the send so you can confirm that you are getting it.
- Andrew