A query is executed in a line by line style so when you do LIMIT 5 before your SORT line, you take whichever first five files from your folder of notes, and sort those. You need to sort the file list, before you limit to only the five you’re interested in.
In other words, try:
```dataview
list
from "6 - Main Notes"
SORT file.mtime desc
limit 5
```