Commands out of sync; you can't run this command now

A hotfix summary

The most common reason for the error commands out of sync are special MariaDB versions which try to optimize queries with big IN() clauses. To stop this behaviour a config var needs to be set either in

(1) the MariaDB server config, e.g. my.cnf inside the category [mysqld]

[mysqld]
in_predicate_conversion_threshold=0


(2) or inside TYPO3 conf vars, using the database init commands

DB:
    Connections:
        Default:
            initCommands: 'SET in_predicate_conversion_threshold=0;

Source: forge.typo3.org/issues/86986