This error can happen because the port you're trying to use is reserved by Windows
You can check if you're trying to use a reserved port by opening <SnapDevelop project folder>\ServerAPIs\Properties\launchSettings.json The profiles.ServerAPIs.applicationUrl indicates the IP address and port that Kestrel will bind to when starting the API Server. Please remember the port number.
Now, execute the following command inside a Windows CMD Terminal: netsh interface ipv4 show excludedportrange protocol=tcp
If the port assigned to profiles.ServerAPIs.applicationUrl is in this list, all you have to do is change the port of the Web API URL in the PowerServer project to a value not in the list and redeploy your PowerServer project.
When you deploy a PowerServer 2021 project, a SnapDevelop project is generated on the location you specified in the WebAPIs tab, the port is also specified there. You can take a look and see if the automatically selected port might be in the Windows reserved port list