Prisma's default maxWait is 2s; under brief pool contention (e.g. assignGalleries holding a connection under its advisory lock) rebuildDirectory's $transaction could fail to even start with 'Unable to start a transaction in the given time', despite already allowing 60s for the transaction body itself via timeout.