1.Check permissions for the SharePoint farm account which you are using to run PowerShell. Make sure the SharePoint farm account is granted with “dbcreator” and “Security_Admin” server roles. And it must have db_owner permission for the content database.
2.Check the IE Enhanced Security Configuration and Firewall are disabled in the SQL Server and SharePoint Server.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.