After enabling recyclebin with the script enablerecyclebin from the sources, there are no more deleted object in "cn=deleted objects" it look like the objects will be deleted immediately. I'm using Samba 4.21.1 from the Debian bookworm-backports and the script from the sources of Samba 4.21.1. So if the script is broken, it should be removed or fixed.
(In reply to Stefan Kania from comment #0) I do not think the script is broken, it appears to do what it should, whether it should be used is another question. If you go here: https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/dd379542(v=ws.10)?redirectedfrom=MSDN You will find this: Important When Active Directory Recycle Bin is enabled, all objects that were deleted before Active Directory Recycle Bin was enabled (that is, all tombstone objects) become recycled objects. These objects are no longer visible in the Deleted Objects container, and they cannot be recovered with Active Directory Recycle Bin. The only way to restore these objects is through an authoritative restore from a backup of AD DS that was taken of the environment before Active Directory Recycle Bin was enabled. Which to myself, sounds like Stefan's problem.
The problem isn't just that the objects in the “deleted objects” folder—which were already there before activation—disappear, but that after activation, no objects are saved there at all. The folder remains empty.