The function
Sort variables function refers to the sorting in the characteristic attribute table (not in the variable manager). When a new variable is created, it is initially automatically sorted to the last position.
After clicking on the button, the Sort table variables dialog box opens. Here you can use the and buttons to set the position as required.