The problem arises during the construction of a prepared statement when sub-selects are added to the main statement.
The indexes of user parameters have to be adapted to their new positions within the resulting statement (which consists of the main statement and the sub-select).