Whether this issue occurs to folders of one site collection or folders of all site collections?
Will the same error be reported when sharing individual file to these impacted users?
Whether these impacted users use the same email tenant?
Please follow below tips to troubleshoot the issue.
1.Go to SharePoint admin center -> Policies -> Sharing -> Check whether you set expire date for guest users.
2.Go to Microsoft 365 admin center -> Users -> Guest users -> Delete these impacted users, then re-share folder.