[SOLVED] V13: referenceindex:update - ‘Prepared statement contains too many placeholders’

I have a TYPO3 v13 (mysql 8.0, PHP 8.3), where the update of the ReferenceIndex runs into an exception:

Update index of table sys_category
----------------------------------

   0/166 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   0%
                                                                                                    
  [ Doctrine\DBAL\Exception\DriverException ]                                                       
  An exception occurred while executing a query: Prepared statement contains too many placeholders

Specifically, the command always stumbles at sys_category. The instance has 161 categories and 36,000 relations (sys_category_record_mm).

Is this a problem with our site or a general problem with TYPO3?
Has anyone had something similar?

Most likely a bug like https://review.typo3.org/c/Packages/TYPO3.CMS/+/89197 or https://review.typo3.org/c/Packages/TYPO3.CMS/+/89100 - could you check forge if a bug report for this exists, and otherwise file it?

It goes exactly in the direction of the two issues. Thank you for the hints!

I did not find an issue on Forge, but after some searching/debugging I found the source of the problem: bulkInsert(). And then I also noticed that the method ihas already been fixed in main: