Have you tried changing the pattern for matching the password prompt? Perhaps the following to allow any (or no) number of spaces:
in reply to Run interactive commands with "Net::SSH::Expect"
Have you tried increasing your timeout?
You might also want to make each error message within your program unique, so that you know for sure where the error is occurring.
$ssh->waitfor('password:\s*',100) or die "Where is the password prompt
$ssh->waitfor('password:\s*',100) or die "Where is the FIRST password