Welcome to Microsoft Q&A! Thanks for posting a good question!
Kindly ensure that the problem is not caused by having a duplicate entry web.config file generated that has a duplicate entry in the parent web.config
For example/similar case:
If the issue still persists, furthermore, to fetch more on the error you can always review the Application Logs > Failed request tracing and/or capture a network trace (F12).
To highlight further, each app has the default root path (/) mapped to D:\home\site\wwwroot, where your code is deployed by default. If your app root is in a different folder, or if your repository has more than one application, you can edit or add virtual applications and directories.
To configure virtual applications and directories, specify each virtual directory and its corresponding physical path relative to the website root (D:\home).
Optionally, you can select the Application checkbox to mark a virtual directory as an application.
Hope this helps! Let us know how it goes we would be more than happy to assist you further.