Persistence of Spreadsheet custom sorts: question and/or bug

I notice that the Spreadsheet editor preserves the definition of the Custom Sort (defined on the Data tab) with the Workbook in which it was defined. I.e., I can close and re-open a Workbook and the last custom sort defined for that Workbook is still defined, but that definition does not appear if I open a new or different Workbook.

I cannot find any documentation of this feature. Is it guaranteed? Are custom sorts for individual Worksheets stored with the Worksheets? Any other restraints/features?

If this is a supported feature, there is a bug: the Sort Options are not preserved. At least, in my case, the “My data has headers” setting is lost if the Workbook is closed and re-opened.