If you want to list authors who appear multiple times, you need to count them globally in the list of all authors, not locally in the list of authors of a proceeding:
let $docs := doc("C:\Users\User\Desktop\p.xml")/documents,
$authors := $docs//author,
$distinct-authors := distinct-values($authors)
for $author in $distinct-authors
where count($authors[. eq $author]) > 1
return $author