What sort() actually wants
Range.sort() accepts either a single column number or an array of sort-spec objects. Each object has two keys: column (an integer) and ascending (a boolean). The array order determines sort priority: the first spec is the primary sort, the second breaks ties, and so on.
The thing that trips people up is that column is always sheet-absolute. Column A is always 1, column B is always 2, no matter where your getRange call starts. If your data starts in column D and you pass column: 1, Apps Script sorts by column A, which is probably empty, and your data comes back in the original order with no error and no warning. I have watched this bite people who copy a range from a template that started in column A into a sheet where the data begins in column D.