in reply to Net::SFTP::Foreign timeout value is inaccurate

The connection is aborted after $timeout seconds.

The issue is that aborting the connection sometimes takes time. In your case $timeout * 3 seconds.

Enable debugging in order to see what's going on under the hood:

$Net::SFTP::Foreign::debug = -1;