Thank you for sharing the details.
We have investigated the both scenarios by deploying the application in IIS 7 at root and also at sub-directory and found the same issue, at root deployment in IIS it works properly as required but at sub-directory it throw exception as you shared.
Solution to this issue is by adding the sub-directory name in the "Scripts/AnnotationWidget.js" line 1548 as:
var baseUrl = urlParts.schema + '://' + urlParts.authority + '/GroupDocs.Demo.Annotation.webforms-orig';
Please try this solution and let us know if you still face any such issues.