After providing the Dev team with the function in question and examples, they are aware that if any filter is applied to the media folders, no details will return.
“We’re aware of this issue. The problem’s actually upstream with WordPress and will be fixed in 6.2.1”