Regression in 278881e37619278789942513916acafaa88d26f3 caused by a lack
of expression copying when an OrderBy expression is explicitly provided.
Thanks Jannis Vajen for the report and regression test.
Backport of b15f162f252610e3b510ade465549769ab4356cf from main