Hibernate 5.3.20 - "Encountered a duplicated sql alias" in native SQL queries after upgrade from 3.6.9

We recently upgraded our application from Hibernate 3.6.9.Final to 5.3.20.Final and are now facing issues with several native SQL queries that previously worked fine in 3.x.
After the upgrade, we are encountering the following error when executing certain native queries:
“Encountered a duplicated sql alias during auto-discovery of a native-sql query”
Hibernate 3.x allowed these queries, but it seems Hibernate 5.x enforces stricter alias checking during result mapping.

Given that we have over 1000 entity classes and a large number of such queries, manually rewriting each one to add column aliases would be extremely time-consuming and error-prone.

Is there any setting, configuration flag, or compatibility mode in Hibernate 5.x that can disable or relax this alias check for native queries?

No there is not. You will have to fix your queries.