Hi @adv_kd,
Thank you for posting in this community.
1.Do you mean the entire URL of your site collection is https://contoso.sharepoint.com
? As you said, the URL for the site set should be https://contoso.sharepoint.com/sites/siteName.
If your URL doesn't meet the specification then something may have gone wrong when they were created, and I would suggest that you re-create this site collection.
2.I also tried creating sub-sites and applying custom templates and everything works fine. By your description, this issue is only happening on this particular site. This is most likely a random error. We suggest you clear browser cache and then try again. If the problem persists then the best solution would be to recreate that site collection.
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.