For me it always adds the FILTER header when I use the Capture module to do a preview.
This weekend I was able to recreate the issue 3 times in a row doing the following:
1. Take a preview image from the Capture Module with a filter (for me this is my Lum in slot 1).
2. Using the scheduler run a job that would use the same filter as just used in preview mode, submit the job.
3. Any of images that start in the sequence that have the same filter for the preview end up with NO 'FILTER' header in the FITS image. Once the filter changes all images end up with a FILTER header.
If the EFW was in a different filter slot than the first filter used in the sequence then all images get the FILTER header.
Note, this doesn't even need to used the Ekos Scheduler, it can also be just done via the Capture Sequence. The other week while I was doing my flats all the Luminance images had no FILTER header as they happened to be the first ones taken after doing a preview capture.
I hope this helps. I've also been looking into the code of both Ekos and INDI. Still can't work out where it is but hopefully the details I've provided might give you some idea where to look.