Thank you for your reply. I think I can see the problem. When I try with working devices, it prompts for "Username: " and the script works. But the device that having the issue, require
1) an Enter 1st and then
2) prompt for "login: ".
That's where the device is timing out.
Any suggestion? Please let me know.