I have found that the NSOrderedSet used in my Swift script (one-file only) is not deduplicating things at all on Linux. It works fine on macOS. Surprisingly, Swift 5.5 on Linux doesn't throw an error for this, either.
However, it is not an ideal choice to use a giant Swift-Collections package with a one-file-only Swift script.
Is there any other choice of ordered deduplicators similar to NSOrderedSet?
If copying the source of OrderedSet into your script is unacceptable, there is no acceptable alternative. Unfortunately scripts can't import packages and there is no other built in OrderedSet alternative.