Try this solution out: Order pages by the id
As for why: you are sorting strings; “A1” < “A1000” < “A2”.