Postgres DB duplicate key Error by updating from Sonarqube 9.6 to 9.7

Hello,
I am trying to update from sonarqube 9.6 to 9.7 via /setup.
The Server version is postgres 11.16.
The migration process fails and I get the following error message in the web.log:

org.sonar.server.platform.db.migration.step.MigrationStepExecutionException: Execution of migration step #6608 'Remove branch information from 'kee' in 'components'' 
failed at  org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:79)
at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:67)
at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:422)
at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:52)
at org.sonar.server.platform.db.migration.engine.MigrationEngineImpl.execute(MigrationEngineImpl.java:66)
at org.sonar.server.platform.db.migration.DatabaseMigrationImpl.doUpgradeDb(DatabaseMigrationImpl.java:105)
at org.sonar.server.platform.db.migration.DatabaseMigrationImpl.doDatabaseMigration(DatabaseMigrationImpl.java:80)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.IllegalStateException: Error during processing of row: [kee=<-1->:src/main/kotlin/com/<->/emma/<->/mqtt/LisaBackchannelCl
ient.kt:BRANCH:test,uuid=AYGftvhbsJhtuzhoRXhf]
at org.sonar.server.platform.db.migration.step.SelectImpl.newExceptionWithRowDetails(SelectImpl.java:89)
at org.sonar.server.platform.db.migration.step.SelectImpl.scroll(SelectImpl.java:81)
at org.sonar.server.platform.db.migration.step.MassUpdate.execute(MassUpdate.java:93)
at org.sonar.server.platform.db.migration.version.v97.RemoveBranchInformationFromComponentsKey.execute(RemoveBranchInformationFromComponentsKey.java:47)
at org.sonar.server.platform.db.migration.step.DataChange.execute(DataChange.java:44)
at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:75)
... 9 common frames omitted
Caused by: java.sql.BatchUpdateException: Batch entry 0 update components set kee = '<-2->' where uuid= 'AYMRKAakenJfudp65unU' was aborted: E
RROR: duplicate key value violates unique constraint "idx_336156_projects_kee"
Detail: Key (kee)=(<-2->) already exists. Call getNextException to see other errors in the batch.
at org.postgresql.jdbc.BatchResultHandler.handleError(BatchResultHandler.java:165)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2367)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:560)
at org.postgresql.jdbc.PgStatement.internalExecuteBatch(PgStatement.java:887)
at org.postgresql.jdbc.PgStatement.executeBatch(PgStatement.java:910)
at org.postgresql.jdbc.PgPreparedStatement.executeBatch(PgPreparedStatement.java:1663)
at com.zaxxer.hikari.pool.ProxyStatement.executeBatch(ProxyStatement.java:127)
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeBatch(HikariProxyPreparedStatement.java)
at org.sonar.server.platform.db.migration.step.UpsertImpl.addBatch(UpsertImpl.java:56)
at org.sonar.server.platform.db.migration.step.MassUpdate.callSingleHandler(MassUpdate.java:120)
at org.sonar.server.platform.db.migration.step.MassUpdate.lambda$execute$0(MassUpdate.java:93)
at org.sonar.server.platform.db.migration.step.SelectImpl.scroll(SelectImpl.java:78)
... 13 common frames omitted
Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "idx_336156_projects_kee"
Detail: Key (kee)=(<-2->) already exists.
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2676)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2366)
... 23 common frames omitted

Does anybody have an idea how I can I fix this issue that the migration to 9.7 will work?