getfolderbyserverrelativeurl returns 200 for a folder that does not existgotchas / rest-apiIt answers HTTP 200 with {"Exists": false} (and ListItemAllFields 200 with {"odata.null": true}), so a check on response.ok skips creating the folder and the next call 404s inside breakroleinheritance; measure the…
A folder's Files collection rejects a two-level $expandgotchas / rest-apiListItemAllFields/Editor 400s there; take ModifiedBy/Author from the file, and list one level through the folder API rather than a FileDirRef filter