FYI - the patch that I validated to work for me, is the following:
https://gitlab.com/samba-team/samba/-/merge_requests/4013.diff
I've manually rebuilt the package following this guide:
https://wiki.debian.org/BuildingTutorial#Get_the_source_package
More specifically, using these steps:
apt install build-essential fakeroot devscripts
apt source samba
apt build-dep samba
cd samba-4.22.0+dfsg/debian/patches/
wget https://gitlab.com/samba-team/samba/-/merge_requests/4013.diff
echo 4013.diff >> series
cd ../..
debuild -b -uc -us
cd ..
You can afterwards install the relevant packages using dpkg -i
<package1>.deb <package2>.deb ...
Cheers,
Timo