I contacted upstream and verified that the bug has been fixed on Samba 4.15.
There fix consists of several patches and now we have to evaluate whether it makes sense to backport everything to Focal.
FWIW, these are the commits that apparently fix the issue (I haven't tested them myself):
05d70f92b633284044d1cd14314eadb3645c1e09 88b3d3443b3a581ec301430346b3e9bf05d81b5e 609ca657652862fd9c81fd11f818efb74f72ff55 0730b936d7a8f55389873d72cb0996ab941f15d7 e656d8b1ad4c70a7c85a66945d7c7d807fce9b6c de28d915d7f135c43c35cf2b5167f9603e99b1f6
I contacted upstream and verified that the bug has been fixed on Samba 4.15.
There fix consists of several patches and now we have to evaluate whether it makes sense to backport everything to Focal.
FWIW, these are the commits that apparently fix the issue (I haven't tested them myself):
05d70f92b633284 044d1cd14314ead b3645c1e09 ec301430346b3e9 bf05d81b5e d9c81fd11f818ef b74f72ff55 389873d72cb0996 ab941f15d7 7c85a66945d7c7d 807fce9b6c 43c35cf2b5167f9 603e99b1f6
88b3d3443b3a581
609ca657652862f
0730b936d7a8f55
e656d8b1ad4c70a
de28d915d7f135c