I would like to format %_file_mod_date% as YYMMDD but

The data is formatted according to the local OS settings.
So please show us how the date looks in your OS.

In my OS it looks like this:
grafik

$num() transforms a string into a number and takes all numeric characters up to the first non-numeric character and then pads the resulting number until the length corresponds to the set number of digits.
In your case it looks to me like the 6 is followed by a non-numeric character.

See also e.g. here: