Why won't a column of numbers sort in numerical order in a calc spreadsheet?

I have 243 names in column A with corresponding ID numbers in column B. I sort on column A (name). I then copy A and B and paste them into D and E, so I can sort on E and wind up with a reverse lookup list. When I sort on E (ID number), the sort winds up not in numerical order.

try additional Option [x]natural Sort on →Data→Sort....

One obvious check: are your ID numbers actually saved as integers, or are they saved as strings? From your report it is the latter & karolus’s answer will be the way to fix it in the short term.