Regarding this error, see this doc: A network-related or instance-specific error occurred while establishing a connection to SQL Server.
This article provides some steps to help you troubleshoot these errors, which are provided in order of the issues from simple to complex.
It is recommended that you gather the information before proceeding with the actual steps to troubleshoot the error.
Best regards,
Cosmog Hong
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".