Hi @adil
Hope you a good weekend.
What steps have you taken before you meet these error?
Here is a similar error message after the user created or extended a web application:
https://social.technet.microsoft.com/Forums/office/en-US/65aa5ddb-9b1f-4af9-9501-b0a24f9ccb76/error-invalid-uri-the-hostname-could-not-be-parsed-while-creating-or-extending-web-application?forum=sharepointadmin
In this case, you could check the permissions of the account which you used, you could also check whether you are using a full host name in the bindings in IIS for another web application.
Thanks,
Yi Lu
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.