Update: When using the kernel of trixie, the failure rate improves a little bit (now is 35% on machines with 1 CPU, and 45% on machines with 2 CPUs).
(Unfortunately, bookworm will still use the kernel of bookworm and anybody building the package may find that the package FTBFS randomly). Could you please forward the bug upstream at least? Thanks.