Hello. At the request of Andrew I've tried again with the current version and this is what I found:
The current version (5.0.10+dfsg-1) fails to build approximately 50% of the time. I've put several build logs for the current version in the same directory as before: https://people.debian.org/~sanvila/build-logs/202605/ I still believe this is a bug in the package. My build machines are created from scratch every time, they have enough memory and enough disk space, and they are prepared deterministically using ansible recipes. It may be the case that the build fails more often here than, say, on a machine with 16 CPU cores, but I don't see a good reason why the build should fail here at all. If you need a VM to reproduce, please contact me privately. Thanks.

