I have a script which creates a number of the following pairs of worksheets in order:
WorkSheet (holds data) -> ChartSheet using WorkSheet
I'm the author of XlsxWriter. It is possible to do it but it isn't advisable.
Each worksheet has an internal index which is used by Excel to track the relationship of different workbook objects.
Sorting the worksheets might work in some simple cases but for more complex workbooks it could lead to problems.