Hi Marco, In 61e083732 (org-attach: Possibly delete empty attach directory, 2021-07-09), you added a call to directory-empty-p. This function was introduced in Emacs's 0806075520 (Add directory-empty-p and new argument COUNT for directory-files-*, 2020-11-02) and hasn't yet made it into a release.
Could you update org-attach-sync to avoid using directory-empty-p (e.g., by inlining it or by adding a compatibility alias)? Thanks.