Custom fields are recorded as historical expense data when selecting the custom field for an expense. If the custom field does not have an External ID at the time of the selection, it will not be available in the export even if you add or modify it later.
Therefore, if an expense has a populated External ID but this data is missing from the export file, this means that the External ID was added after the custom field had been selected for the expense. You can resolve this issue by unselecting that custom field from the expense and selecting it again so that the new information from the field will be available in the export.