This is my current working configuration for MacOS Ventura 13.1 for TimeMachine hosted on a RaspberryPi home NAS and FreeBSD server.
Tested with Samba version 4.13.13-Debian on the RaspberryPi (Conmpute module 4 with IO board), and 4.16.8 on the FreeBSD 13.1.
The following is added to the smb.conf (in Debian is /etc/samba/smb.conf, in FreeBSD is /usr/local/etc/smb4.conf)
[TimeMachine]
path = /nas/backup
public = yes
browseable = Yes
guest ok = yes
vfs objects = fruit streams_xattr
read only = No
inherit acls = Yes
fruit:time machine = yes
writeable = yes
create mask = 0600
directory mask = 0700
spotlight = yes
fruit:nfs_aces = No
netbios name = freenas
fruit:aapl = yes
vfs objects = catia fruit streams_xattr
fruit:resource = file
fruit:metadata = stream
fruit:locking = none
fruit:encoding = native
mdns name = mdns
ea support = yes
fruit:posix_rename = yes
fruit:veto_appledouble = no
fruit:wipe_intentionally_left_blank_rfork = yes
fruit:delete_empty_adfiles = yes
fruit:aapl = yes