Procedure with "bind varibale" does not return the desired result set
order by 2 does not equal to order by :ord where :ord = 2.
With order by 2, 2 represents a position, meaning the result must be sorted always by 2nd column in select list.
With order by :ord, :ord is an expression, which will be evaluated to a value, and sorting will be done by that value, not a column.
If you use order by :ord where :ord = 2, that is handled like like order by '2' (logically, ignore the type difference for now).
Do not bind the order by position.