I’ve just noticed on my Mojave machine that if a file name has a space in its extension (eg. “My script.scpt alias”), the Finder, System Events, NSURL, and NSString all return the relevant ‘name extension’ or ‘pathExtension()’ as an empty string (“”). No problem with the full ‘name’ or ‘lastPathComponent()’.
The same’s true with the Finder on my El Capitan system, but there System Events and the Foundation methods all correctly return the extension as “scpt alias”.