Used the same approach as for #34176 by using selected expressions position to prevent ambiguous aliases in collisions. Thanks henribru for the report. Regression in 04518e310d. Backport of 278881e376 from main
04518e310d
278881e376