it does not always fail. It only fails when the connection attempt exceeds 15 seconds.
Maybe you could try connecting using other tools like SSMS to verify if the issue still exists.
In other hand, you could check the SQL Server error logs which may provide more details.
Best regards,
Cosmog
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".